mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 17:33:03 -05:00
fix(athena): report a HUGEINT result column as bigint (#8254)
This commit is contained in:
1 parent
ea4427ca58
commit
8185a340c4
3 files changed
+21
-2
No files matched your search
+15
@@ -41,4 +41,19 @@ class AthenaColumnTypesSidecarIntegrationTest {
|
||||
assertEquals(List.of("bigint", "double", "boolean", "date", "decimal", "varchar", "time", "timestamp",
|
||||
"timestamp with time zone"), types);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trino returns BIGINT for {@code count_if} and for {@code sum} over a BIGINT; DuckDB widens both
|
||||
* to HUGEINT, which Athena clients must still see as bigint.
|
||||
*/
|
||||
@Test
|
||||
void aggregatesDuckDbWidensToHugeintAreReportedAsBigint() {
|
||||
List<String> duckTypes = duck.query("DESCRIBE SELECT count_if(true) AS c, sum(CAST(1 AS BIGINT)) AS s", null)
|
||||
.stream()
|
||||
.map(column -> String.valueOf(column.get("column_type")))
|
||||
.toList();
|
||||
|
||||
assertEquals(List.of("HUGEINT", "HUGEINT"), duckTypes);
|
||||
assertEquals(List.of("bigint", "bigint"), duckTypes.stream().map(AthenaService::athenaType).toList());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user