You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Paul Stewart <pa...@imperva.com> on 2016/10/07 15:42:06 UTC

Spark 2.0 Encoder().schema() is sorting StructFields

When using the Encoder(Bean.class).schema() method to generate the StructType array
of StructFields the class attributes are returned as a sorted list and not
in the defined order within the Bean.class.  This makes the schema unusable
for reading from a CSV file where the ordering of the attributes is
significant.

Is there anyway to cause the Encoder().schema() method to return the array
of StructFields in the original definition order of the Bean.class?

Regards,
Paul


---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org