You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2019/05/21 03:59:12 UTC

[jira] [Updated] (SPARK-19322) Allow customizable column name in ScalaReflection.schemaFor

     [ https://issues.apache.org/jira/browse/SPARK-19322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyukjin Kwon updated SPARK-19322:
---------------------------------
    Labels: bulk-closed  (was: )

> Allow customizable column name in ScalaReflection.schemaFor
> -----------------------------------------------------------
>
>                 Key: SPARK-19322
>                 URL: https://issues.apache.org/jira/browse/SPARK-19322
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 2.1.0
>            Reporter: Wei Liu
>            Priority: Minor
>              Labels: bulk-closed
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> When creating StructType using ScalaRelfection.schemaFor, the column names are defined by scala case class parameter names. This causes minor inconvenience when reading/writing data between Python and Scala which follow different naming conventions. Ideally, we should allow customize column names using Scala annotations in a similar fashion to Jackson serialization libraries.
> For example, we could define schema as :
> case class MySchema(@fieldName("long_field") longField: Long, @fieldName("int_field") intField: Int)
> The field/column names can now be customized.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org