vboo123 opened a new pull request, #56764:
URL: https://github.com/apache/spark/pull/56764

   ### What changes were proposed in this pull request?
   
   This PR adds unit-test coverage for the TIME data type (`TimeType`, 
`java.time.LocalTime`) to three existing catalyst test suites, bringing TIME to 
parity with the sibling DATE/TIMESTAMP test cases already present in each:
   
   - **ExpressionEncoderSuite** — Added `LocalTime` encoder round-trip tests: a 
plain time value, midnight boundary, max-microseconds boundary 
(23:59:59.999999), an array of times, and `Option`/`Map` variants. Mirrors the 
existing date/timestamp `encodeDecodeTest` cases.
   - **DDLParserSuite** — Added a test covering `TIME` and `TIME(p)` precision 
columns in `CREATE TABLE`, `ALTER TABLE ADD COLUMNS`, `ALTER COLUMN ... TYPE`, 
a column with a TIME typed-literal `DEFAULT`, and `PARTITIONED BY` a TIME 
column. Mirrors the existing SPARK-57164 nanosecond-timestamp DDL test.
   - **DataTypeWriteCompatibilitySuite** — Added a dedicated TIME 
write-compatibility test in the shared base suite so it executes under both the 
strict (`canUpCast`) and ANSI (`canANSIStoreAssign`) store-assignment policies. 
It checks TIME→TIME across precisions and TIME↔DATE/TIMESTAMP/TIMESTAMP_NTZ in 
both directions, deriving the allowed/rejected expectation from the 
policy-bound cast rule. Mirrors the existing SPARK-37707 datetime-compatibility 
test.
   
   No production code is changed. This is test-only.
   
   ### Why are the changes needed?
   
   The TIME data type shipped in Spark 4.1.0 (SPIP SPARK-51162), but catalyst 
unit-test coverage for TIME lags behind DATE and TIMESTAMP. This PR closes that 
gap as part of the SPARK-57550 umbrella (extend TIME type support across the 
codebase). Adequate test coverage is needed to catch regressions as further 
TIME integration work lands.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   All three suites were run individually and pass locally:
   
   - `build/sbt "catalyst/testOnly *ExpressionEncoderSuite"` — 399 tests pass
   - `build/sbt "catalyst/testOnly 
org.apache.spark.sql.catalyst.parser.DDLParserSuite"` — 149 tests pass
   - `build/sbt "catalyst/testOnly *StrictDataTypeWriteCompatibilitySuite 
*ANSIDataTypeWriteCompatibilitySuite"` — 60 tests pass (the new TIME test 
executes under both policies)
   
   No existing tests were modified.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Yes. Generated using Kiro (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]

Reply via email to