From 8adee8072917970ed0d8501b80971bbcdcb53070 Mon Sep 17 00:00:00 2001 From: Michael Bogdanov Date: Tue, 10 Dec 2024 19:34:26 +0100 Subject: [PATCH] Revert "fix(cubesql): convert properly DataType::Timestamp into ColumnType::Timestamp" This reverts commit b702a1132966fa8da308a71cc4f58efe4a74baed. --- rust/cubesql/cubesql/src/sql/dataframe.rs | 40 ++--------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/rust/cubesql/cubesql/src/sql/dataframe.rs b/rust/cubesql/cubesql/src/sql/dataframe.rs index d932fe75a6212..8052e5535f383 100644 --- a/rust/cubesql/cubesql/src/sql/dataframe.rs +++ b/rust/cubesql/cubesql/src/sql/dataframe.rs @@ -404,7 +404,8 @@ pub fn arrow_to_column_type(arrow_type: DataType) -> Result Ok(ColumnType::String), DataType::Date32 => Ok(ColumnType::Date(false)), DataType::Date64 => Ok(ColumnType::Date(true)), - DataType::Timestamp(_, _) => Ok(ColumnType::Timestamp), + // build test + DataType::Timestamp(_, _) => Ok(ColumnType::String), DataType::Interval(unit) => Ok(ColumnType::Interval(unit)), DataType::Float16 | DataType::Float32 | DataType::Float64 => Ok(ColumnType::Double), DataType::Boolean => Ok(ColumnType::Boolean), @@ -794,41 +795,4 @@ mod tests { serde_json::to_string(&frame.data).unwrap() ); } - - #[test] - fn test_arrow_to_column_type() { - let cases = vec![ - (DataType::Binary, ColumnType::Blob), - (DataType::Utf8, ColumnType::String), - (DataType::LargeUtf8, ColumnType::String), - (DataType::Date32, ColumnType::Date(false)), - (DataType::Date64, ColumnType::Date(true)), - ( - DataType::Timestamp(TimeUnit::Second, None), - ColumnType::Timestamp, - ), - ( - DataType::Interval(IntervalUnit::YearMonth), - ColumnType::Interval(IntervalUnit::YearMonth), - ), - (DataType::Float16, ColumnType::Double), - (DataType::Float32, ColumnType::Double), - (DataType::Float64, ColumnType::Double), - (DataType::Boolean, ColumnType::Boolean), - (DataType::Int32, ColumnType::Int32), - (DataType::UInt32, ColumnType::Int32), - (DataType::Int8, ColumnType::Int64), - (DataType::Int16, ColumnType::Int64), - (DataType::Int64, ColumnType::Int64), - (DataType::UInt8, ColumnType::Int64), - (DataType::UInt16, ColumnType::Int64), - (DataType::UInt64, ColumnType::Int64), - (DataType::Null, ColumnType::String), - ]; - - for (arrow_type, expected_column_type) in cases { - let result = arrow_to_column_type(arrow_type.clone()).unwrap(); - assert_eq!(result, expected_column_type, "Failed for {:?}", arrow_type); - } - } }