Skip to content

Commit e1aa6e9

Browse files
authored
Merge branch 'master' into vertica_driver
2 parents 78a2119 + 9327f70 commit e1aa6e9

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

docs/pages/reference/configuration/environment-variables.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,14 @@ The timeout value for any queries made to the database by Cube.
560560
| ---------------------------------------- | ---------------------- | --------------------- |
561561
| A number in seconds or a duration string | `10m` | `10m` |
562562

563+
<InfoBox>
564+
565+
There's a hard limit of 20 minutes for queries that ingest data into Cube Store
566+
when pre-aggregations are built. If you bump into this limit, consider using an
567+
export bucket and splitting pre-aggregations into partitions.
568+
569+
</InfoBox>
570+
563571
## `CUBEJS_DB_FETCH_COLUMNS_BY_ORDINAL_POSITION`
564572

565573
Force fetching of columns by ordinal positions. Certain data-providers (e.g., Redshift) do not guarantee columns in the

packages/cubejs-testing/test/smoke-cubesql.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('SQL API', () => {
119119
expect(JSON.parse(chunk.toString()).schema).toEqual([
120120
{
121121
name: 'orderDate',
122-
column_type: 'String',
122+
column_type: 'Timestamp',
123123
},
124124
]);
125125
} else {

rust/cubesql/cubesql/src/sql/dataframe.rs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ pub fn arrow_to_column_type(arrow_type: DataType) -> Result<ColumnType, CubeErro
404404
DataType::Utf8 | DataType::LargeUtf8 => Ok(ColumnType::String),
405405
DataType::Date32 => Ok(ColumnType::Date(false)),
406406
DataType::Date64 => Ok(ColumnType::Date(true)),
407-
DataType::Timestamp(_, _) => Ok(ColumnType::String),
407+
DataType::Timestamp(_, _) => Ok(ColumnType::Timestamp),
408408
DataType::Interval(unit) => Ok(ColumnType::Interval(unit)),
409409
DataType::Float16 | DataType::Float32 | DataType::Float64 => Ok(ColumnType::Double),
410410
DataType::Boolean => Ok(ColumnType::Boolean),
@@ -794,4 +794,41 @@ mod tests {
794794
serde_json::to_string(&frame.data).unwrap()
795795
);
796796
}
797+
798+
#[test]
799+
fn test_arrow_to_column_type() {
800+
let cases = vec![
801+
(DataType::Binary, ColumnType::Blob),
802+
(DataType::Utf8, ColumnType::String),
803+
(DataType::LargeUtf8, ColumnType::String),
804+
(DataType::Date32, ColumnType::Date(false)),
805+
(DataType::Date64, ColumnType::Date(true)),
806+
(
807+
DataType::Timestamp(TimeUnit::Second, None),
808+
ColumnType::Timestamp,
809+
),
810+
(
811+
DataType::Interval(IntervalUnit::YearMonth),
812+
ColumnType::Interval(IntervalUnit::YearMonth),
813+
),
814+
(DataType::Float16, ColumnType::Double),
815+
(DataType::Float32, ColumnType::Double),
816+
(DataType::Float64, ColumnType::Double),
817+
(DataType::Boolean, ColumnType::Boolean),
818+
(DataType::Int32, ColumnType::Int32),
819+
(DataType::UInt32, ColumnType::Int32),
820+
(DataType::Int8, ColumnType::Int64),
821+
(DataType::Int16, ColumnType::Int64),
822+
(DataType::Int64, ColumnType::Int64),
823+
(DataType::UInt8, ColumnType::Int64),
824+
(DataType::UInt16, ColumnType::Int64),
825+
(DataType::UInt64, ColumnType::Int64),
826+
(DataType::Null, ColumnType::String),
827+
];
828+
829+
for (arrow_type, expected_column_type) in cases {
830+
let result = arrow_to_column_type(arrow_type.clone()).unwrap();
831+
assert_eq!(result, expected_column_type, "Failed for {:?}", arrow_type);
832+
}
833+
}
797834
}

0 commit comments

Comments
 (0)