@@ -112,6 +112,8 @@ class DuckDbTest {
112112 val float8Col : Double ,
113113 @ColumnName(" float_col" )
114114 val floatCol : Float ,
115+ @ColumnName(" geometry_col" )
116+ val geometryCol : Blob ,
115117 @ColumnName(" hugeint_col" )
116118 val hugeintCol : BigInteger ,
117119 @ColumnName(" int128_col" )
@@ -158,6 +160,8 @@ class DuckDbTest {
158160 val textCol : String ,
159161 @ColumnName(" time_col" )
160162 val timeCol : LocalTime ,
163+ @ColumnName(" time_ns_col" )
164+ val timeNsCol : LocalTime ,
161165 @ColumnName(" timestamp_col" )
162166 val timestampCol : Instant ,
163167 @ColumnName(" timestamptz_col" )
@@ -201,6 +205,12 @@ class DuckDbTest {
201205 bitCol = " 1010" ,
202206 bitstringCol = " 1010" ,
203207 blobCol = DuckDBResultSet .DuckDBBlobResult (ByteBuffer .wrap(" DEADBEEF" .toByteArray())),
208+ // TODO improve this test case once DuckDB supports the geometry type fully
209+ geometryCol = DuckDBResultSet .DuckDBBlobResult (
210+ ByteBuffer .wrap(
211+ byteArrayOf(1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 62 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 36 , 64 ),
212+ ),
213+ ),
204214 boolCol = true ,
205215 booleanCol = true ,
206216 bpcharCol = " test" ,
@@ -237,6 +247,7 @@ class DuckDbTest {
237247 stringCol = " test string" ,
238248 textCol = " test text" ,
239249 timeCol = LocalTime .parse(" 12:34:56" ),
250+ timeNsCol = LocalTime .parse(" 12:34:56" ),
240251 timestampCol = Timestamp .valueOf(" 2025-06-19 12:34:56" ).toInstant().toKotlinInstant(),
241252 timestamptzCol = JavaOffsetDateTime .parse(" 2025-06-19T12:34:56+02:00" ),
242253 timestampwtzCol = JavaOffsetDateTime .parse(" 2025-06-19T12:34:56+02:00" ),
@@ -289,6 +300,8 @@ class DuckDbTest {
289300 val stringlistlistCol : List <List <String ?>? >,
290301 @ColumnName(" union_col" )
291302 val unionCol : Any ,
303+ @ColumnName(" variant_col" )
304+ val variantCol : Any ,
292305 )
293306
294307 // endregion
@@ -464,6 +477,7 @@ class DuckDbTest {
464477 float8_col FLOAT8,
465478 float_col FLOAT,
466479 float4_col FLOAT4,
480+ geometry_col GEOMETRY,
467481 real_col REAL,
468482 hugeint_col HUGEINT,
469483 int128_col INT128,
@@ -479,6 +493,7 @@ class DuckDbTest {
479493 int16_col INT16,
480494 short_col SHORT,
481495 time_col TIME,
496+ time_ns_col TIME_NS,
482497 timestampwtz_col TIMESTAMP WITH TIME ZONE,
483498 timestamptz_col TIMESTAMPTZ,
484499 timestamp_col TIMESTAMP,
@@ -529,6 +544,7 @@ class DuckDbTest {
529544 3.14159, -- float8
530545 3.14, -- float
531546 3.14, -- float4
547+ 'POINT (30 10)'::GEOMETRY, -- geometry
532548 3.14, -- real
533549 '170141183460469231731687303715884105727', -- hugeint
534550 '170141183460469231731687303715884105727', -- int128
@@ -544,6 +560,7 @@ class DuckDbTest {
544560 32767, -- int16
545561 32767, -- short
546562 '12:34:56', -- time
563+ '12:34:56', -- time_ns
547564 '2025-06-19 12:34:56+02', -- timestampwtz
548565 '2025-06-19 12:34:56+02', -- timestamptz
549566 '2025-06-19 12:34:56', -- timestamp
@@ -610,6 +627,7 @@ class DuckDbTest {
610627 ijstruct_col STRUCT(i INTEGER, j VARCHAR),
611628 ijstructlist_col STRUCT(i INTEGER, j VARCHAR)[],
612629 union_col UNION(num INTEGER, text VARCHAR),
630+ variant_col VARIANT,
613631 )
614632 """ .trimIndent(),
615633 ).executeUpdate()
@@ -628,6 +646,7 @@ class DuckDbTest {
628646 { 'i': 42, 'j': 'answer' }, -- struct
629647 list_value({ 'i': 42, 'j': 'answer' }, { 'i': 44, 'j': 'answer' }), -- struct list
630648 union_value(num := 2), -- union
649+ 'a'::VARIANT, -- variant
631650 )
632651 """ .trimIndent(),
633652 ).executeUpdate()
@@ -660,6 +679,7 @@ class DuckDbTest {
660679 NestedEntry (44 , " answer" ),
661680 )
662681 it[" union_col" ] shouldBe 2
682+ it[" variant_col" ] shouldBe " a"
663683 }
664684 }
665685
0 commit comments