Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

feat: extend bigInt casting to support UBIGINT HUGEINT UHUGEINT in duckdb (#3227)

Xun Li2e24bd207fb3
diff --git a/src/duckdb/src/table/duckdb-table-utils.ts b/src/duckdb/src/table/duckdb-table-utils.ts
index c293079c8..a1a60994a 100644
--- a/src/duckdb/src/table/duckdb-table-utils.ts
+++ b/src/duckdb/src/table/duckdb-table-utils.ts
@@ -111,7 +111,11 @@ export function castDuckDBTypesForKepler(
const quotedColumnName = quoteColumnName(name);
if (type === 'GEOMETRY' && options.geometryToWKB) {
return `ST_AsWKB(${quotedColumnName}) as ${quotedColumnName}`;
- } else if (type === 'BIGINT' && options.bigIntToDouble) {
+ } else if (
+ options.bigIntToDouble &&
+ (type === 'BIGINT' || type === 'UBIGINT' || type === 'HUGEINT' || type === 'UHUGEINT')
+ ) {
+ // Cast 64-bit and larger integer types to DOUBLE to avoid BigInt in JS
return `CAST(${quotedColumnName} AS DOUBLE) as ${quotedColumnName}`;
}
return quotedColumnName;