stevomitric opened a new pull request, #57700: URL: https://github.com/apache/spark/pull/57700
### What changes were proposed in this pull request? Defines read-through behavior for persisted tables with nanosecond timestamp columns (TIMESTAMP_NTZ(p)/TIMESTAMP_LTZ(p), p in [7,9]) when spark.sql.timestampNanosTypes.enabled is off. DataType.fromJson now reconstructs nanos types regardless of the flag (removes the two checkTimestampNanosTypesEnabled() calls in DataType.nameToType), mirroring the TIME type. The SQL parser path and analysis-time gate (TypeUtils.failUnsupportedDataType) stay gated. ### Why are the changes needed? With the flag off, restoring a persisted nanos table's schema went through DataType.fromJson and threw FEATURE_NOT_ENABLED, so DESCRIBE, SHOW CREATE TABLE, and even DROP TABLE failed — the table was completely unmanageable. TIME types don't have this problem. Read-through fixes it while still blocking data access until the flag is on. ### Does this PR introduce _any_ user-facing change? Yes, within unreleased master (preview feature under SPARK-56822). With the flag off: metadata/DDL commands now succeed and render the nanos columns (DESCRIBE shows timestamp_ntz(9)), and the table can be dropped; reading the data (SELECT *) still fails with an actionable FEATURE_NOT_ENABLED. Previously all of these failed. ### How was this patch tested? New/updated unit tests: DataTypeSuite (fromJson read-through), HiveExternalCatalogSuite (catalog restore with flag off), HiveDDLSuite (DESCRIBE / SHOW CREATE / DROP / view persistence succeed, SELECT * fails). All green. ### Was this patch authored or co-authored using generative AI tooling? Co-authored-by: Claude Code (Claude Opus 4.8) -- 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]
