This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-5133-dbe0448887d6dfb9d3384377bf66ab658391205f in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git
commit 68e62056692a515b7f96f049bad1fd6bf62be18b Author: Peter Lee <[email protected]> AuthorDate: Wed Sep 23 20:24:17 2026 +0000 fix: support null calendar interval literals (#5133) * fix: support null calendar interval literals * andy's review * switch back to explicit matching for planner with Literal expr --- native/core/src/execution/planner.rs | 3 +++ .../sql-tests/expressions/datetime/calendar_interval.sql | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/native/core/src/execution/planner.rs b/native/core/src/execution/planner.rs index 1f94a89261..5406df4f04 100644 --- a/native/core/src/execution/planner.rs +++ b/native/core/src/execution/planner.rs @@ -561,6 +561,9 @@ impl PhysicalPlanner { DataType::Duration(TimeUnit::Microsecond) => { ScalarValue::DurationMicrosecond(None) } + DataType::Interval(arrow::datatypes::IntervalUnit::MonthDayNano) => { + ScalarValue::IntervalMonthDayNano(None) + } dt => { return Err(GeneralError(format!("{dt:?} is not supported in Comet"))) } diff --git a/spark/src/test/resources/sql-tests/expressions/datetime/calendar_interval.sql b/spark/src/test/resources/sql-tests/expressions/datetime/calendar_interval.sql index 796e6354ac..6eaa9648f2 100644 --- a/spark/src/test/resources/sql-tests/expressions/datetime/calendar_interval.sql +++ b/spark/src/test/resources/sql-tests/expressions/datetime/calendar_interval.sql @@ -18,6 +18,20 @@ -- Config: spark.comet.exec.localTableScan.enabled=true -- Config: spark.comet.shuffle.mode=native +statement +CREATE TABLE test_null_interval(id int) USING parquet + +statement +INSERT INTO test_null_interval VALUES (1) + +-- Null calendar interval literal in a projection over a real scan. +query +SELECT CAST(NULL AS INTERVAL) FROM test_null_interval + +-- NullPropagation folds make_interval with a null argument to a null interval literal. +query +SELECT make_interval(NULL, 2, 3, 4, 5, 6, 7.008009) FROM test_null_interval + query SELECT * FROM VALUES (make_interval(1, 2, 3, 4, 5, 6, 7.008009)), --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
