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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
