You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/12/16 12:23:31 UTC
[GitHub] [spark] Peng-Lei commented on pull request #34780: [SPARK-37517][SQL] Keep consistent order of columns with user specify for v1 table
Peng-Lei commented on pull request #34780:
URL: https://github.com/apache/spark/pull/34780#issuecomment-995767333
> To understand this issue better, today Spark reorders the user-specified schema in CREATE TABLE and always puts partition columns at the end?
@cloud-fan
I try to learn about it. I found that Spark reorders the user-specified schema in CREATE TABLE. Because the reorder logic in a analyzer, which works with both data source tables and hive serde tables. In particular, CTAS, if provider is FileFormat. The HadoopFsRelation have data schema and partition schema individually. The schema of HadoopFsRelation is `data schema + partition schema - overlapped`, So although I remove the reorder logic in a analyzer rule. The schema also is `data schema + partition schema - overlapped`. It is same to hive serde tables. when we get information from HiveCatalog, we will reorder the schema to put the partition column at end. Am I wrong?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org