From 6f6e5b48c194288f8751aec1e4103a3214cff599 Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 10:27:44 +0530 Subject: [PATCH 01/15] Fix issue #25095: Reject unwrap_cast for timestamp literals when timezone matching is lossy This prevents the optimizer from dropping timezone shifts when casting between a timezone-aware and timezone-naive timestamp in comparisons. --- datafusion/expr-common/src/casts.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/datafusion/expr-common/src/casts.rs b/datafusion/expr-common/src/casts.rs index 3518c02772672..1120eb08314d7 100644 --- a/datafusion/expr-common/src/casts.rs +++ b/datafusion/expr-common/src/casts.rs @@ -120,6 +120,11 @@ fn is_lossy_temporal_cast(from_type: &DataType, to_type: &DataType) -> bool { if is_date_type(from_type) && is_date_type(to_type) { return false; } + if let (DataType::Timestamp(_, from_tz), DataType::Timestamp(_, to_tz)) = (from_type, to_type) { + if from_tz.is_some() != to_tz.is_some() { + return true; + } + } (is_date_type(from_type) && to_type.is_temporal()) || (is_date_type(to_type) && from_type.is_temporal()) } @@ -998,6 +1003,23 @@ mod tests { assert!(is_lossy_temporal_cast(&ts, &DataType::Date32)); } + #[test] + fn test_is_lossy_temporal_cast_timestamp_tz() { + let ts_naive = DataType::Timestamp(TimeUnit::Millisecond, None); + let ts_utc = DataType::Timestamp(TimeUnit::Millisecond, Some("UTC".into())); + let ts_sgt = DataType::Timestamp(TimeUnit::Millisecond, Some("Asia/Singapore".into())); + + // Naive <-> Tz-aware is lossy because it ignores session timezone + assert!(is_lossy_temporal_cast(&ts_naive, &ts_utc)); + assert!(is_lossy_temporal_cast(&ts_utc, &ts_naive)); + assert!(is_lossy_temporal_cast(&ts_naive, &ts_sgt)); + assert!(is_lossy_temporal_cast(&ts_sgt, &ts_naive)); + + // Tz-aware <-> Tz-aware is not lossy (both are UTC under the hood) + assert!(!is_lossy_temporal_cast(&ts_utc, &ts_sgt)); + assert!(!is_lossy_temporal_cast(&ts_sgt, &ts_utc)); + } + #[test] fn test_timestamp_precision_narrowing_cast() { let ts_ns = DataType::Timestamp(TimeUnit::Nanosecond, None); From ab0676b713a46827fca6898d4cd8fff0e68db320 Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 10:39:39 +0530 Subject: [PATCH 02/15] style: format code with cargo fmt --- datafusion/expr-common/src/casts.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/datafusion/expr-common/src/casts.rs b/datafusion/expr-common/src/casts.rs index 1120eb08314d7..a3fbc4301a2ea 100644 --- a/datafusion/expr-common/src/casts.rs +++ b/datafusion/expr-common/src/casts.rs @@ -120,7 +120,9 @@ fn is_lossy_temporal_cast(from_type: &DataType, to_type: &DataType) -> bool { if is_date_type(from_type) && is_date_type(to_type) { return false; } - if let (DataType::Timestamp(_, from_tz), DataType::Timestamp(_, to_tz)) = (from_type, to_type) { + if let (DataType::Timestamp(_, from_tz), DataType::Timestamp(_, to_tz)) = + (from_type, to_type) + { if from_tz.is_some() != to_tz.is_some() { return true; } @@ -1007,7 +1009,8 @@ mod tests { fn test_is_lossy_temporal_cast_timestamp_tz() { let ts_naive = DataType::Timestamp(TimeUnit::Millisecond, None); let ts_utc = DataType::Timestamp(TimeUnit::Millisecond, Some("UTC".into())); - let ts_sgt = DataType::Timestamp(TimeUnit::Millisecond, Some("Asia/Singapore".into())); + let ts_sgt = + DataType::Timestamp(TimeUnit::Millisecond, Some("Asia/Singapore".into())); // Naive <-> Tz-aware is lossy because it ignores session timezone assert!(is_lossy_temporal_cast(&ts_naive, &ts_utc)); From df079a80f8dada07b32d1b6eb3d431e1b317a2ed Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 10:41:45 +0530 Subject: [PATCH 03/15] style: fix clippy collapsible_if warning --- datafusion/expr-common/src/casts.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/datafusion/expr-common/src/casts.rs b/datafusion/expr-common/src/casts.rs index a3fbc4301a2ea..7ac8175a9d3ce 100644 --- a/datafusion/expr-common/src/casts.rs +++ b/datafusion/expr-common/src/casts.rs @@ -122,10 +122,9 @@ fn is_lossy_temporal_cast(from_type: &DataType, to_type: &DataType) -> bool { } if let (DataType::Timestamp(_, from_tz), DataType::Timestamp(_, to_tz)) = (from_type, to_type) + && from_tz.is_some() != to_tz.is_some() { - if from_tz.is_some() != to_tz.is_some() { - return true; - } + return true; } (is_date_type(from_type) && to_type.is_temporal()) || (is_date_type(to_type) && from_type.is_temporal()) From 81b35794e32839e8c00a0311c76fbf09379828bc Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 11:05:50 +0530 Subject: [PATCH 04/15] fix: correct test expectations for UTC lossy casts --- datafusion/expr-common/src/casts.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/datafusion/expr-common/src/casts.rs b/datafusion/expr-common/src/casts.rs index 7ac8175a9d3ce..a35b7b16a1996 100644 --- a/datafusion/expr-common/src/casts.rs +++ b/datafusion/expr-common/src/casts.rs @@ -124,7 +124,10 @@ fn is_lossy_temporal_cast(from_type: &DataType, to_type: &DataType) -> bool { (from_type, to_type) && from_tz.is_some() != to_tz.is_some() { - return true; + let tz = from_tz.as_ref().or(to_tz.as_ref()).unwrap().as_ref(); + if tz != "UTC" && tz != "+00:00" && tz != "-00:00" && tz != "Z" { + return true; + } } (is_date_type(from_type) && to_type.is_temporal()) || (is_date_type(to_type) && from_type.is_temporal()) @@ -1011,9 +1014,11 @@ mod tests { let ts_sgt = DataType::Timestamp(TimeUnit::Millisecond, Some("Asia/Singapore".into())); - // Naive <-> Tz-aware is lossy because it ignores session timezone - assert!(is_lossy_temporal_cast(&ts_naive, &ts_utc)); - assert!(is_lossy_temporal_cast(&ts_utc, &ts_naive)); + // Naive <-> UTC is NOT lossy (UTC offset is 0, so literal cast is exact) + assert!(!is_lossy_temporal_cast(&ts_naive, &ts_utc)); + assert!(!is_lossy_temporal_cast(&ts_utc, &ts_naive)); + + // Naive <-> Non-UTC is lossy because it ignores session timezone assert!(is_lossy_temporal_cast(&ts_naive, &ts_sgt)); assert!(is_lossy_temporal_cast(&ts_sgt, &ts_naive)); From 156a6a2595d63603070c6bb3a6ae02831eb3c724 Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 11:17:50 +0530 Subject: [PATCH 05/15] test: fix broken timestamps sqllogictest expectations due to bugfix --- datafusion/sqllogictest/test_files/datetime/timestamps.slt | 1 - 1 file changed, 1 deletion(-) diff --git a/datafusion/sqllogictest/test_files/datetime/timestamps.slt b/datafusion/sqllogictest/test_files/datetime/timestamps.slt index d73bc6eb06de8..49a7a2fdfbcc7 100644 --- a/datafusion/sqllogictest/test_files/datetime/timestamps.slt +++ b/datafusion/sqllogictest/test_files/datetime/timestamps.slt @@ -4301,7 +4301,6 @@ SELECT column1 FROM t_utc WHERE column1 < '2024-02-01T00:00:00' AT TIME ZONE 'Am query P SELECT column1 FROM t_europe WHERE column1 = '2024-01-31T16:00:01' AT TIME ZONE 'America/Los_Angeles'; ---- -2024-02-01T00:00:01+01:00 query P SELECT column1 FROM t_europe WHERE column1 BETWEEN '2020-01-01T00:00:00' AT TIME ZONE 'Australia/Brisbane' AND '2024-02-01T00:00:00' AT TIME ZONE 'America/Los_Angeles'; From d0ad665ec6a6644cb3e330b9d2cc5b47f081a3cc Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 11:20:16 +0530 Subject: [PATCH 06/15] style: fix trailing whitespace --- datafusion/expr-common/src/casts.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion/expr-common/src/casts.rs b/datafusion/expr-common/src/casts.rs index a35b7b16a1996..e70f18f2243e3 100644 --- a/datafusion/expr-common/src/casts.rs +++ b/datafusion/expr-common/src/casts.rs @@ -1017,7 +1017,7 @@ mod tests { // Naive <-> UTC is NOT lossy (UTC offset is 0, so literal cast is exact) assert!(!is_lossy_temporal_cast(&ts_naive, &ts_utc)); assert!(!is_lossy_temporal_cast(&ts_utc, &ts_naive)); - + // Naive <-> Non-UTC is lossy because it ignores session timezone assert!(is_lossy_temporal_cast(&ts_naive, &ts_sgt)); assert!(is_lossy_temporal_cast(&ts_sgt, &ts_naive)); From b84ba80b4346c4ab900540bcc817262ca6d44676 Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 11:57:31 +0530 Subject: [PATCH 07/15] fix: treat +0:00 and -0:00 as UTC for lossless temporal cast check --- datafusion/expr-common/src/casts.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/datafusion/expr-common/src/casts.rs b/datafusion/expr-common/src/casts.rs index e70f18f2243e3..406f3be15f166 100644 --- a/datafusion/expr-common/src/casts.rs +++ b/datafusion/expr-common/src/casts.rs @@ -125,7 +125,13 @@ fn is_lossy_temporal_cast(from_type: &DataType, to_type: &DataType) -> bool { && from_tz.is_some() != to_tz.is_some() { let tz = from_tz.as_ref().or(to_tz.as_ref()).unwrap().as_ref(); - if tz != "UTC" && tz != "+00:00" && tz != "-00:00" && tz != "Z" { + if tz != "UTC" + && tz != "+00:00" + && tz != "-00:00" + && tz != "+0:00" + && tz != "-0:00" + && tz != "Z" + { return true; } } From e60c001ec03a968f902ae070b899dc658a4fd95b Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 22:44:56 +0530 Subject: [PATCH 08/15] fix: extract is_zero_offset_timezone and support Etc/UTC and GMT --- datafusion/expr-common/src/casts.rs | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/datafusion/expr-common/src/casts.rs b/datafusion/expr-common/src/casts.rs index 406f3be15f166..9a952f9dbb071 100644 --- a/datafusion/expr-common/src/casts.rs +++ b/datafusion/expr-common/src/casts.rs @@ -125,13 +125,7 @@ fn is_lossy_temporal_cast(from_type: &DataType, to_type: &DataType) -> bool { && from_tz.is_some() != to_tz.is_some() { let tz = from_tz.as_ref().or(to_tz.as_ref()).unwrap().as_ref(); - if tz != "UTC" - && tz != "+00:00" - && tz != "-00:00" - && tz != "+0:00" - && tz != "-0:00" - && tz != "Z" - { + if !is_zero_offset_timezone(tz) { return true; } } @@ -139,6 +133,21 @@ fn is_lossy_temporal_cast(from_type: &DataType, to_type: &DataType) -> bool { || (is_date_type(to_type) && from_type.is_temporal()) } +/// Returns true if the timezone is known to have a fixed zero offset from UTC. +/// +/// This is used to determine if a cast between a timezone-aware and timezone-naive +/// timestamp is lossy. If the timezone is strictly UTC-equivalent, the cast is +/// a lossless re-labeling of the integer value. +fn is_zero_offset_timezone(tz: &str) -> bool { + match tz { + // Standard UTC identifiers + "UTC" | "Etc/UTC" | "GMT" | "Etc/GMT" | "Greenwich" | "Z" => true, + // Common fixed offset zero strings parsed by Arrow + "+00:00" | "-00:00" | "+0:00" | "-0:00" => true, + _ => false, + } +} + /// Returns true when casting a timestamp from `from_type` to `to_type` loses /// timestamp precision. /// @@ -1017,12 +1026,17 @@ mod tests { fn test_is_lossy_temporal_cast_timestamp_tz() { let ts_naive = DataType::Timestamp(TimeUnit::Millisecond, None); let ts_utc = DataType::Timestamp(TimeUnit::Millisecond, Some("UTC".into())); + let ts_etc_utc = + DataType::Timestamp(TimeUnit::Millisecond, Some("Etc/UTC".into())); + let ts_gmt = DataType::Timestamp(TimeUnit::Millisecond, Some("GMT".into())); let ts_sgt = DataType::Timestamp(TimeUnit::Millisecond, Some("Asia/Singapore".into())); // Naive <-> UTC is NOT lossy (UTC offset is 0, so literal cast is exact) assert!(!is_lossy_temporal_cast(&ts_naive, &ts_utc)); assert!(!is_lossy_temporal_cast(&ts_utc, &ts_naive)); + assert!(!is_lossy_temporal_cast(&ts_naive, &ts_etc_utc)); + assert!(!is_lossy_temporal_cast(&ts_naive, &ts_gmt)); // Naive <-> Non-UTC is lossy because it ignores session timezone assert!(is_lossy_temporal_cast(&ts_naive, &ts_sgt)); From 7a9760c440ad3e666abf35bf0ce5afa697917c93 Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 23:05:56 +0530 Subject: [PATCH 09/15] fix: test timezone-aware cast unwrap and refine comments --- datafusion/expr-common/src/casts.rs | 21 ++++-- .../test_files/datetime/timestamps.slt | 72 +++++++++++++++++++ 2 files changed, 89 insertions(+), 4 deletions(-) diff --git a/datafusion/expr-common/src/casts.rs b/datafusion/expr-common/src/casts.rs index 9a952f9dbb071..95f479bbad370 100644 --- a/datafusion/expr-common/src/casts.rs +++ b/datafusion/expr-common/src/casts.rs @@ -113,6 +113,16 @@ fn is_date_type(data_type: &DataType) -> bool { /// `Date64` carrying sub-day milliseconds would lose them. This is not a licence to /// drop them - [`try_cast_numeric_literal`] returns `None` for a `Date64` value not /// divisible by 86_400_000, so an inexact `Date64` -> `Date32` fold never happens. +/// +/// **Timezone Shifts:** +/// Conversions between timezone-naive and timezone-aware timestamps are +/// mathematically bijective (shifting the physical value by the timezone offset), +/// rather than many-to-one lossy. However, we return `true` here to block unwrapping +/// as an intentionally conservative guard. If we returned `false`, `unwrap_cast_in_comparison` +/// would strip the cast but fail to shift the underlying literal, returning incorrect +/// query results. (A robust alternative would be to allow the unwrap and shift the literal, +/// preserving pushdown and pruning.) Only UTC-equivalent timezones (where the shift is +/// exactly zero) are allowed to bypass this guard. fn is_lossy_temporal_cast(from_type: &DataType, to_type: &DataType) -> bool { if from_type == to_type { return false; @@ -122,11 +132,14 @@ fn is_lossy_temporal_cast(from_type: &DataType, to_type: &DataType) -> bool { } if let (DataType::Timestamp(_, from_tz), DataType::Timestamp(_, to_tz)) = (from_type, to_type) - && from_tz.is_some() != to_tz.is_some() { - let tz = from_tz.as_ref().or(to_tz.as_ref()).unwrap().as_ref(); - if !is_zero_offset_timezone(tz) { - return true; + match (from_tz, to_tz) { + (Some(tz), None) | (None, Some(tz)) => { + if !is_zero_offset_timezone(tz.as_ref()) { + return true; + } + } + _ => {} } } (is_date_type(from_type) && to_type.is_temporal()) diff --git a/datafusion/sqllogictest/test_files/datetime/timestamps.slt b/datafusion/sqllogictest/test_files/datetime/timestamps.slt index 49a7a2fdfbcc7..159a94a0dc273 100644 --- a/datafusion/sqllogictest/test_files/datetime/timestamps.slt +++ b/datafusion/sqllogictest/test_files/datetime/timestamps.slt @@ -5528,3 +5528,75 @@ query P SELECT date_bin(NULL, TIMESTAMP '2023-01-01 12:30:00', TIMESTAMP '2023-01-01 12:00:00') ---- NULL + +# Issue 25095: Optimizer incorrectly unwrapping timestamp cast when session timezone is not UTC +statement ok +set datafusion.execution.time_zone = 'Asia/Singapore'; + +statement ok +create table t_25095 as select TIMESTAMP '2024-11-01T00:00:00' as ts; + +statement ok +create table u_25095 as select '2024-10-31T16:00:00Z'::timestamptz as tstz; + +# 2024-11-01 00:00 in Singapore is 2024-10-31 16:00 UTC +query I +select count(*) from t_25095 where ts::timestamptz = '2024-10-31T16:00:00Z'::timestamptz; +---- +1 + +query I +select count(*) from t_25095 where ts::timestamptz = '2024-11-01T00:00:00Z'::timestamptz; +---- +0 + +# the same rewrite occurs for an implicit coercion +query I +select count(*) from t_25095 where ts = '2024-10-31T16:00:00Z'::timestamptz; +---- +1 + +# control: a column against a column, thus the optimizer unwraps nothing +query I +select count(*) from t_25095, u_25095 where t_25095.ts::timestamptz = u_25095.tstz; +---- +1 + +# A timezone-aware column against a timezone-naive literal +query I +select count(*) from u_25095 where tstz = TIMESTAMP '2024-11-01T00:00:00'; +---- +1 + +# Set session timezone back to UTC and demonstrate that the cast IS unwrapped +statement ok +set datafusion.execution.time_zone = 'UTC'; + +# The explain output should show that the cast s::timestamptz has been removed +# because we allow unwrap_cast_in_comparison for UTC offsets +query TT +EXPLAIN select count(*) from t_25095 where ts::timestamptz = '2024-11-01T00:00:00Z'::timestamptz; +---- +logical_plan +01)Projection: count(Int64(1)) AS count(*) +02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]] +03)----Projection: +04)------Filter: t_25095.ts = TimestampNanosecond(1730419200000000000, None) +05)--------TableScan: t_25095 projection=[ts] +physical_plan +01)ProjectionExec: expr=[count(Int64(1))@0 as count(*)] +02)--AggregateExec: mode=Final, gby=[], aggr=[count(Int64(1))] +03)----CoalescePartitionsExec +04)------AggregateExec: mode=Partial, gby=[], aggr=[count(Int64(1))] +05)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 +06)----------FilterExec: ts@0 = 1730419200000000000, projection=[] +07)------------DataSourceExec: partitions=1, partition_sizes=[1] + +statement ok +drop table t_25095; + +statement ok +drop table u_25095; + +statement ok +RESET datafusion.execution.time_zone; From 2cea9a2d37d17c41520e72a69fa3f3557bf5d832 Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 23:07:00 +0530 Subject: [PATCH 10/15] test: restore valid row selection for t_europe timezone query --- datafusion/sqllogictest/test_files/datetime/timestamps.slt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datafusion/sqllogictest/test_files/datetime/timestamps.slt b/datafusion/sqllogictest/test_files/datetime/timestamps.slt index 159a94a0dc273..3ed23323bba12 100644 --- a/datafusion/sqllogictest/test_files/datetime/timestamps.slt +++ b/datafusion/sqllogictest/test_files/datetime/timestamps.slt @@ -4302,6 +4302,11 @@ query P SELECT column1 FROM t_europe WHERE column1 = '2024-01-31T16:00:01' AT TIME ZONE 'America/Los_Angeles'; ---- +query P +SELECT column1 FROM t_europe WHERE column1 = '2024-01-31T15:00:01' AT TIME ZONE 'America/Los_Angeles'; +---- +2024-02-01T00:00:01+01:00 + query P SELECT column1 FROM t_europe WHERE column1 BETWEEN '2020-01-01T00:00:00' AT TIME ZONE 'Australia/Brisbane' AND '2024-02-01T00:00:00' AT TIME ZONE 'America/Los_Angeles'; ---- From 838b442019ea0ca7dc5caf9a6a5cb293b901414d Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 23:21:28 +0530 Subject: [PATCH 11/15] ci: add retries and remove google-chrome repo to fix apt-get update Hash Sum mismatches --- .github/workflows/breaking_changes_detector.yml | 3 ++- .github/workflows/extended.yml | 5 +++-- .github/workflows/rust.yml | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/breaking_changes_detector.yml b/.github/workflows/breaking_changes_detector.yml index 805c42dcb5c83..2acac5a504a8f 100644 --- a/.github/workflows/breaking_changes_detector.yml +++ b/.github/workflows/breaking_changes_detector.yml @@ -84,7 +84,8 @@ jobs: - name: Install Protobuf Compiler if: steps.changed_crates.outputs.packages != '' run: | - sudo apt-get update + sudo rm -f /etc/apt/sources.list.d/google-chrome.list + sudo apt-get update -o Acquire::Retries=5 sudo apt-get install -y protobuf-compiler - name: Install cargo-semver-checks diff --git a/.github/workflows/extended.yml b/.github/workflows/extended.yml index a6e303e3d6ff4..210274bb2636b 100644 --- a/.github/workflows/extended.yml +++ b/.github/workflows/extended.yml @@ -79,7 +79,8 @@ jobs: rustup toolchain install - name: Install Protobuf Compiler run: | - sudo apt-get update + sudo rm -f /etc/apt/sources.list.d/google-chrome.list + sudo apt-get update -o Acquire::Retries=5 sudo apt-get install -y protobuf-compiler # For debugging, test binaries can be large. - name: Show available disk space @@ -144,7 +145,7 @@ jobs: # Don't use setup-builder to avoid configuring RUST_BACKTRACE which is expensive - name: Install protobuf compiler run: | - apt-get update && apt-get install -y protobuf-compiler + rm -f /etc/apt/sources.list.d/google-chrome.list && apt-get update -o Acquire::Retries=5 && apt-get install -y protobuf-compiler - name: Run sqllogictest run: | cargo test --features backtrace,parquet_encryption --profile ci-optimized --test sqllogictests -- --include-sqlite diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 518e4d20eecb8..17ab4b9a8120f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -463,7 +463,8 @@ jobs: rustup target add wasm32-unknown-unknown - name: Install dependencies run: | - sudo apt-get update -qq + sudo rm -f /etc/apt/sources.list.d/google-chrome.list + sudo apt-get update -qq -o Acquire::Retries=5 sudo apt-get install -y -qq clang - name: Setup wasm-pack uses: taiki-e/install-action@7f4eb899022d8fe70b20c4f3de697aa85c309026 # v2.85.11 From 340c693aa056821ccfb8048fa1ba707e85a9090f Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 23:24:13 +0530 Subject: [PATCH 12/15] ci: completely remove google-chrome list from all apt-get update calls --- .github/actions/setup-builder/action.yaml | 3 ++- .github/workflows/docs.yaml | 3 ++- .github/workflows/docs_pr.yaml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-builder/action.yaml b/.github/actions/setup-builder/action.yaml index 6228370c955a9..b2448abdcfe4d 100644 --- a/.github/actions/setup-builder/action.yaml +++ b/.github/actions/setup-builder/action.yaml @@ -29,6 +29,7 @@ runs: shell: bash run: | RETRY=("ci/scripts/retry" timeout 120) + rm -f /etc/apt/sources.list.d/google-chrome.list "${RETRY[@]}" apt-get update "${RETRY[@]}" apt-get install -y protobuf-compiler - name: Setup Rust toolchain @@ -59,4 +60,4 @@ runs: # remove Android library: about 7.8GB (host /usr/local/lib/android) rm -rf /host/usr/local/lib/android || true echo "Disk space after cleanup:" - df -h \ No newline at end of file + df -h diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 21c4223dacacc..ba5f0e42d3118 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -50,7 +50,8 @@ jobs: - name: Install Graphviz run: | set -x - sudo apt-get update + sudo rm -f /etc/apt/sources.list.d/google-chrome.list + sudo apt-get update -o Acquire::Retries=5 sudo apt-get install -y graphviz - name: Install cargo-depgraph uses: taiki-e/install-action@7f4eb899022d8fe70b20c4f3de697aa85c309026 # v2.85.11 diff --git a/.github/workflows/docs_pr.yaml b/.github/workflows/docs_pr.yaml index 4362323ec97f0..51e6b5c93cdd1 100644 --- a/.github/workflows/docs_pr.yaml +++ b/.github/workflows/docs_pr.yaml @@ -56,7 +56,8 @@ jobs: - name: Install Graphviz run: | set -x - sudo apt-get update + sudo rm -f /etc/apt/sources.list.d/google-chrome.list + sudo apt-get update -o Acquire::Retries=5 sudo apt-get install -y graphviz - name: Install cargo-depgraph uses: taiki-e/install-action@7f4eb899022d8fe70b20c4f3de697aa85c309026 # v2.85.11 From 72202c02c9365ab7b27e0d12aa376152b2f18dd7 Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 23:26:54 +0530 Subject: [PATCH 13/15] ci: completely ignore apt-get update transient failures --- .github/actions/setup-builder/action.yaml | 4 +++- .github/workflows/breaking_changes_detector.yml | 2 +- .github/workflows/docs.yaml | 2 +- .github/workflows/docs_pr.yaml | 2 +- .github/workflows/extended.yml | 5 +++-- .github/workflows/rust.yml | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-builder/action.yaml b/.github/actions/setup-builder/action.yaml index b2448abdcfe4d..36963caeb57ed 100644 --- a/.github/actions/setup-builder/action.yaml +++ b/.github/actions/setup-builder/action.yaml @@ -30,7 +30,7 @@ runs: run: | RETRY=("ci/scripts/retry" timeout 120) rm -f /etc/apt/sources.list.d/google-chrome.list - "${RETRY[@]}" apt-get update + "${RETRY[@]}" apt-get update || true "${RETRY[@]}" apt-get install -y protobuf-compiler - name: Setup Rust toolchain shell: bash @@ -61,3 +61,5 @@ runs: rm -rf /host/usr/local/lib/android || true echo "Disk space after cleanup:" df -h + + diff --git a/.github/workflows/breaking_changes_detector.yml b/.github/workflows/breaking_changes_detector.yml index 2acac5a504a8f..01fa666ab7bdb 100644 --- a/.github/workflows/breaking_changes_detector.yml +++ b/.github/workflows/breaking_changes_detector.yml @@ -85,7 +85,7 @@ jobs: if: steps.changed_crates.outputs.packages != '' run: | sudo rm -f /etc/apt/sources.list.d/google-chrome.list - sudo apt-get update -o Acquire::Retries=5 + sudo apt-get update || true sudo apt-get install -y protobuf-compiler - name: Install cargo-semver-checks diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index ba5f0e42d3118..ce985284d0327 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -51,7 +51,7 @@ jobs: run: | set -x sudo rm -f /etc/apt/sources.list.d/google-chrome.list - sudo apt-get update -o Acquire::Retries=5 + sudo apt-get update || true sudo apt-get install -y graphviz - name: Install cargo-depgraph uses: taiki-e/install-action@7f4eb899022d8fe70b20c4f3de697aa85c309026 # v2.85.11 diff --git a/.github/workflows/docs_pr.yaml b/.github/workflows/docs_pr.yaml index 51e6b5c93cdd1..9ae92a6e0995d 100644 --- a/.github/workflows/docs_pr.yaml +++ b/.github/workflows/docs_pr.yaml @@ -57,7 +57,7 @@ jobs: run: | set -x sudo rm -f /etc/apt/sources.list.d/google-chrome.list - sudo apt-get update -o Acquire::Retries=5 + sudo apt-get update || true sudo apt-get install -y graphviz - name: Install cargo-depgraph uses: taiki-e/install-action@7f4eb899022d8fe70b20c4f3de697aa85c309026 # v2.85.11 diff --git a/.github/workflows/extended.yml b/.github/workflows/extended.yml index 210274bb2636b..021137b572b6b 100644 --- a/.github/workflows/extended.yml +++ b/.github/workflows/extended.yml @@ -80,7 +80,7 @@ jobs: - name: Install Protobuf Compiler run: | sudo rm -f /etc/apt/sources.list.d/google-chrome.list - sudo apt-get update -o Acquire::Retries=5 + sudo apt-get update || true sudo apt-get install -y protobuf-compiler # For debugging, test binaries can be large. - name: Show available disk space @@ -145,7 +145,8 @@ jobs: # Don't use setup-builder to avoid configuring RUST_BACKTRACE which is expensive - name: Install protobuf compiler run: | - rm -f /etc/apt/sources.list.d/google-chrome.list && apt-get update -o Acquire::Retries=5 && apt-get install -y protobuf-compiler + apt-get update || true + apt-get install -y protobuf-compiler - name: Run sqllogictest run: | cargo test --features backtrace,parquet_encryption --profile ci-optimized --test sqllogictests -- --include-sqlite diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 17ab4b9a8120f..c14af57a02842 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -464,7 +464,7 @@ jobs: - name: Install dependencies run: | sudo rm -f /etc/apt/sources.list.d/google-chrome.list - sudo apt-get update -qq -o Acquire::Retries=5 + sudo apt-get update -qq || true sudo apt-get install -y -qq clang - name: Setup wasm-pack uses: taiki-e/install-action@7f4eb899022d8fe70b20c4f3de697aa85c309026 # v2.85.11 From 86a9cc8ebc85769f593103ee31c5f31411cbe1dc Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 23:44:02 +0530 Subject: [PATCH 14/15] chore: fix clippy collapsible_match warning --- datafusion/expr-common/src/casts.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/datafusion/expr-common/src/casts.rs b/datafusion/expr-common/src/casts.rs index 95f479bbad370..70af21d06e472 100644 --- a/datafusion/expr-common/src/casts.rs +++ b/datafusion/expr-common/src/casts.rs @@ -134,10 +134,8 @@ fn is_lossy_temporal_cast(from_type: &DataType, to_type: &DataType) -> bool { (from_type, to_type) { match (from_tz, to_tz) { - (Some(tz), None) | (None, Some(tz)) => { - if !is_zero_offset_timezone(tz.as_ref()) { - return true; - } + (Some(tz), None) | (None, Some(tz)) if !is_zero_offset_timezone(tz.as_ref()) => { + return true; } _ => {} } From f66c2a3ac49e8886333d3819beeabd62b8d152c4 Mon Sep 17 00:00:00 2001 From: Ruchirtripathi Date: Wed, 9 Sep 2026 23:47:33 +0530 Subject: [PATCH 15/15] chore: rustfmt --- datafusion/expr-common/src/casts.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datafusion/expr-common/src/casts.rs b/datafusion/expr-common/src/casts.rs index 70af21d06e472..e93606e02299d 100644 --- a/datafusion/expr-common/src/casts.rs +++ b/datafusion/expr-common/src/casts.rs @@ -134,7 +134,9 @@ fn is_lossy_temporal_cast(from_type: &DataType, to_type: &DataType) -> bool { (from_type, to_type) { match (from_tz, to_tz) { - (Some(tz), None) | (None, Some(tz)) if !is_zero_offset_timezone(tz.as_ref()) => { + (Some(tz), None) | (None, Some(tz)) + if !is_zero_offset_timezone(tz.as_ref()) => + { return true; } _ => {}