Dejan Krakovic created SPARK-61297:
--------------------------------------
Summary: Check FILE table columns in Declarative Pipelines and in
writes to tables that accept any schema
Key: SPARK-61297
URL: https://issues.apache.org/jira/browse/SPARK-61297
Project: Spark
Issue Type: Sub-task
Components: SQL
Affects Versions: 5.0.0
Reporter: Dejan Krakovic
Follow-up of SPARK-60386 (https://github.com/apache/spark/pull/59640). This
must be fixed before spark.sql.fileType.enabled is enabled by default.
Two paths can still store a FILE without the EXTERNAL qualifier in a table,
because they skip the table schema checks that SPARK-60386 adds:
- Declarative Pipelines: DatasetManager creates and evolves tables through
materializeTable without the V2CreateTablePlan checks
(FILE_TYPE_MISSING_QUALIFIER, FILE_TYPE_UNKNOWN_WRITE, partition and clustering
columns).
- Writes to a V2 table with the ACCEPT_ANY_SCHEMA capability:
V2WriteCommand.outputResolved short-circuits when the table skips schema
resolution, so a bare FILE reaches the connector, and a connector that evolves
its schema from the incoming data would store it.
Proposal: run the stored-schema checks
(TypeUtils.checkNoUnknownFileTypeInTableSchema and the partition/clustering
checks) in DatasetManager before materializeTable, and check the query output
of V2 writes to ACCEPT_ANY_SCHEMA tables for a bare FILE.
Review threads:
https://github.com/apache/spark/pull/59640#discussion_r4353281752 and
https://github.com/apache/spark/pull/59640#discussion_r4382011865
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]