You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by pa...@apache.org on 2025/04/21 23:09:09 UTC

(datafusion-comet) 01/01: fix: handle list with timestamp

This is an automated email from the ASF dual-hosted git repository.

parthc pushed a commit to branch complex-sql-tests2
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git

commit 038e3b1205000e3ea1f060c3e7a1ea83ddc30b1c
Author: Parth Chandra <pa...@apache.org>
AuthorDate: Mon Apr 21 16:05:00 2025 -0700

    fix: handle list with timestamp
---
 common/src/main/java/org/apache/comet/parquet/TypeUtil.java | 5 ++++-
 native/core/src/parquet/parquet_support.rs                  | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/common/src/main/java/org/apache/comet/parquet/TypeUtil.java b/common/src/main/java/org/apache/comet/parquet/TypeUtil.java
index c31497e47..8917efdf9 100644
--- a/common/src/main/java/org/apache/comet/parquet/TypeUtil.java
+++ b/common/src/main/java/org/apache/comet/parquet/TypeUtil.java
@@ -371,7 +371,10 @@ public class TypeUtil {
         return false;
       }
     } else {
-      return false; // one is a primitive type and the other is not.
+      // One is a primitive type and the other is not.
+      // Throw a schema conversion exception
+      throw new SchemaColumnConvertNotSupportedException(
+          requested.toString(), actual.getName(), requested.getName());
     }
     return true;
   }
diff --git a/native/core/src/parquet/parquet_support.rs b/native/core/src/parquet/parquet_support.rs
index 33abdaea5..e005bb938 100644
--- a/native/core/src/parquet/parquet_support.rs
+++ b/native/core/src/parquet/parquet_support.rs
@@ -130,6 +130,12 @@ fn cast_array(
     use DataType::*;
     let array = match to_type {
         Timestamp(_, None) => array, // array_with_timezone does not support to_type of NTZ.
+        List(f) => {
+            match f.data_type() {
+                Timestamp(_, None) => array, // array_with_timezone does not support to_type of NTZ.
+                _ => array_with_timezone(array, parquet_options.timezone.clone(), Some(to_type))?,
+            }
+        }, // array_with_timezone does not support to_type of NTZ.
         _ => array_with_timezone(array, parquet_options.timezone.clone(), Some(to_type))?,
     };
     let from_type = array.data_type().clone();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org