You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Michael Armbrust (JIRA)" <ji...@apache.org> on 2014/09/11 20:03:34 UTC
[jira] [Updated] (SPARK-3421) StructField.toString should quote the
name field to allow arbitrary character as struct field name
[ https://issues.apache.org/jira/browse/SPARK-3421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Armbrust updated SPARK-3421:
------------------------------------
Target Version/s: 1.2.0 (was: 1.1.0)
> StructField.toString should quote the name field to allow arbitrary character as struct field name
> --------------------------------------------------------------------------------------------------
>
> Key: SPARK-3421
> URL: https://issues.apache.org/jira/browse/SPARK-3421
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 1.0.2
> Reporter: Cheng Lian
> Assignee: Cheng Lian
>
> The original use case is something like this:
> {code}
> // JSON snippet with "illegal" characters in field names
> val json =
> """{ "a(b)": { "c(d)": "hello" } }""" ::
> """{ "a(b)": { "c(d)": "world" } }""" ::
> Nil
> val jsonSchemaRdd = sqlContext.jsonRDD(sparkContext.makeRDD(json))
> jsonSchemaRdd.saveAsParquetFile("/tmp/file.parquet")
> java.lang.Exception: java.lang.RuntimeException: Unsupported dataType: StructType(ArrayBuffer(StructField(a(b),StructType(ArrayBuffer(StructField(c(d),StringType,true))),true))), [1.37] failure: `,' expected but `(' found
> {code}
> The reason is that, the {{DataType}} parser only allows {{\[a-zA-Z0-9_\]*}} as struct field name.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org