spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denny Lee <denny.g....@gmail.com>
Subject Re: Spark 1.3 RC1 Generate schema based on string of schema
Date Fri, 20 Feb 2015 16:22:27 GMT
Oh, I just realized that I never imported all of sql._ .  My bad!


On Fri Feb 20 2015 at 7:51:32 AM Denny Lee <denny.g.lee@gmail.com> wrote:

> In the Spark SQL 1.2 Programmers Guide, we can generate the schema based
> on the string of schema via
>
> val schema =
>   StructType(
>     schemaString.split(" ").map(fieldName => StructField(fieldName,
> StringType, true)))
>
> But when running this on Spark 1.3.0 (RC1), I get the error:
>
> val schema =  StructType(schemaString.split(" ").map(fieldName =>
> StructField(fieldName, StringType, true)))
>
> <console>:26: error: not found: value StringType
>
>        val schema =  StructType(schemaString.split(" ").map(fieldName =>
> StructField(fieldName, StringType, true)))
>
> I'm looking through the various datatypes within org.apache.spark.sql.types.DataType
> but thought I'd ask to see if I was missing something obvious here.
>
> Thanks!
>
>
> Denny
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message