test: migrate curated temporal expression tests to SQL file tests#4765
Open
andygrove wants to merge 1 commit into
Open
test: migrate curated temporal expression tests to SQL file tests#4765andygrove wants to merge 1 commit into
andygrove wants to merge 1 commit into
Conversation
Move the temporal expression tests that rely only on curated/literal data into the SQL file test framework, where they read more clearly and live alongside the other datetime fixtures: - unix_timestamp string-input fallback -> unix_timestamp.sql - date_format literal and null inputs -> date_format.sql - cast TimestampNTZ to Timestamp DST edge cases -> cast_timestamp_ntz_dst.sql Fuzz-based, Catalyst-API (Days/Hours), and operator-only tests remain in CometTemporalExpressionSuite since the SQL framework cannot express random 1000-row coverage, Unevaluable partition-transform expressions, or native-execution checks that intentionally skip answer comparison.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Follows up on review feedback from #4761, where @comphead suggested moving the temporal expression suite to the SQL file test framework.
Rationale for this change
CometTemporalExpressionSuitecontains several tests whose value is fully expressible in the SQL file test framework (curated/literal inputs, fallback-reason checks). Those read more clearly as SQL fixtures and live alongside the other datetime/cast fixtures, so this PR migrates that subset and removes the now-redundant Scala versions.The migration is intentionally focused. Many tests in the suite cannot be faithfully expressed as SQL fixtures and are left in place:
last_day,datediff,unix_date, thedate_trunc/date_formatcolumn tests) rely on 1000-row random data that SQL fixtures cannot replicate.days/hourstests buildDays/Hours, which areUnevaluablepartition-transform expressions not reachable through SQL.allowIncompatible-enabled tests verify only that execution stays native (they intentionally skip answer comparison because the native result may diverge from Spark). The SQL framework has no operator-only assertion mode.What changes are included in this PR?
Migrated to SQL file tests and removed from
CometTemporalExpressionSuite:unix_timestampstring-input fallback todatetime/unix_timestamp.sql(viaquery expect_fallback(...))date_formatliteral and null inputs todatetime/date_format.sqlcast TimestampNTZ to TimestampDST edge cases to newcast/cast_timestamp_ntz_dst.sql(Europe/London spring-forward gap and fall-back overlap)The suite drops from 34 to 30 tests.
How are these changes tested?
CometSqlFileTestSuiteruns the migrated fixtures (unix_timestamp.sql,date_format.sql, and the newcast_timestamp_ntz_dst.sql); all pass.CometTemporalExpressionSuite(30/30) continues to pass.