11package io .github .dfa1 .vortex .writer ;
22
3+ import io .github .dfa1 .vortex .core .model .ColumnName ;
4+
35import io .github .dfa1 .vortex .core .model .DType ;
46import io .github .dfa1 .vortex .reader .ReadRegistry ;
57import io .github .dfa1 .vortex .reader .VortexReader ;
@@ -36,9 +38,9 @@ void writeChunk_typed_roundTrips(@TempDir Path tmp) throws IOException {
3638 var sut = VortexWriter .create (ch , SCHEMA , WriteOptions .defaults ())) {
3739 // When
3840 sut .writeChunk (c -> c
39- .put ("timestamp" , new long []{1_700_000_000_000L , 1_700_000_001_000L })
40- .put ("symbol" , new String []{"AAPL" , "AAPL" })
41- .put ("price" , new double []{189.95 , 190.10 }));
41+ .put (ColumnName . of ( "timestamp" ) , new long []{1_700_000_000_000L , 1_700_000_001_000L })
42+ .put (ColumnName . of ( "symbol" ) , new String []{"AAPL" , "AAPL" })
43+ .put (ColumnName . of ( "price" ) , new double []{189.95 , 190.10 }));
4244 }
4345
4446 // Then — file is readable and values round-trip
@@ -58,7 +60,7 @@ void put_unknownColumn_throws(@TempDir Path tmp) throws IOException {
5860 try (var ch = FileChannel .open (file , StandardOpenOption .CREATE , StandardOpenOption .WRITE );
5961 var sut = VortexWriter .create (ch , SCHEMA , WriteOptions .defaults ())) {
6062 // When / Then
61- assertThatThrownBy (() -> sut .writeChunk (c -> c .put ("nope" , new long []{1 })))
63+ assertThatThrownBy (() -> sut .writeChunk (c -> c .put (ColumnName . of ( "nope" ) , new long []{1 })))
6264 .isInstanceOf (IllegalArgumentException .class )
6365 .hasMessageContaining ("unknown column: nope" );
6466 }
@@ -71,7 +73,7 @@ void put_wrongArrayType_throws(@TempDir Path tmp) throws IOException {
7173 try (var ch = FileChannel .open (file , StandardOpenOption .CREATE , StandardOpenOption .WRITE );
7274 var sut = VortexWriter .create (ch , SCHEMA , WriteOptions .defaults ())) {
7375 // When / Then — int[] for I64 column
74- assertThatThrownBy (() -> sut .writeChunk (c -> c .put ("timestamp" , new int []{1 , 2 })))
76+ assertThatThrownBy (() -> sut .writeChunk (c -> c .put (ColumnName . of ( "timestamp" ) , new int []{1 , 2 })))
7577 .isInstanceOf (IllegalArgumentException .class )
7678 .hasMessageContaining ("timestamp" )
7779 .hasMessageContaining ("I64" );
@@ -86,8 +88,8 @@ void missingColumn_throws_atClose(@TempDir Path tmp) throws IOException {
8688 var sut = VortexWriter .create (ch , SCHEMA , WriteOptions .defaults ())) {
8789 // When / Then
8890 assertThatThrownBy (() -> sut .writeChunk (c -> c
89- .put ("timestamp" , new long []{1L })
90- .put ("symbol" , new String []{"A" })))
91+ .put (ColumnName . of ( "timestamp" ) , new long []{1L })
92+ .put (ColumnName . of ( "symbol" ) , new String []{"A" })))
9193 .isInstanceOf (IllegalStateException .class )
9294 .hasMessageContaining ("missing column: price" );
9395 }
@@ -104,7 +106,7 @@ void nullable_i64Column_acceptsBoxedArrayWithNulls(@TempDir Path tmp) throws IOE
104106 try (var ch = FileChannel .open (file , StandardOpenOption .CREATE , StandardOpenOption .WRITE );
105107 var sut = VortexWriter .create (ch , nullableSchema , WriteOptions .defaults ())) {
106108 // When
107- sut .writeChunk (c -> c .put ("v" , new Long []{1L , null , 3L }));
109+ sut .writeChunk (c -> c .put (ColumnName . of ( "v" ) , new Long []{1L , null , 3L }));
108110 }
109111
110112 // Then — file is well-formed; the masked encoding output is verified by the
@@ -119,7 +121,7 @@ void nonNullable_i64Column_rejectsBoxedArray(@TempDir Path tmp) throws IOExcepti
119121 try (var ch = FileChannel .open (file , StandardOpenOption .CREATE , StandardOpenOption .WRITE );
120122 var sut = VortexWriter .create (ch , SCHEMA , WriteOptions .defaults ())) {
121123 // When / Then
122- assertThatThrownBy (() -> sut .writeChunk (c -> c .put ("timestamp" , new Long []{1L , 2L })))
124+ assertThatThrownBy (() -> sut .writeChunk (c -> c .put (ColumnName . of ( "timestamp" ) , new Long []{1L , 2L })))
123125 .isInstanceOf (IllegalArgumentException .class )
124126 .hasMessageContaining ("non-nullable" )
125127 .hasMessageContaining ("timestamp" );
@@ -134,8 +136,8 @@ void duplicatePut_throws(@TempDir Path tmp) throws IOException {
134136 var sut = VortexWriter .create (ch , SCHEMA , WriteOptions .defaults ())) {
135137 // When / Then
136138 assertThatThrownBy (() -> sut .writeChunk (c -> c
137- .put ("timestamp" , new long []{1L })
138- .put ("timestamp" , new long []{2L })))
139+ .put (ColumnName . of ( "timestamp" ) , new long []{1L })
140+ .put (ColumnName . of ( "timestamp" ) , new long []{2L })))
139141 .isInstanceOf (IllegalArgumentException .class )
140142 .hasMessageContaining ("duplicate" )
141143 .hasMessageContaining ("timestamp" );
@@ -150,9 +152,9 @@ void columnLengthMismatch_throws(@TempDir Path tmp) throws IOException {
150152 var sut = VortexWriter .create (ch , SCHEMA , WriteOptions .defaults ())) {
151153 // When / Then — timestamp has 2 rows, symbol has 3, price has 2
152154 assertThatThrownBy (() -> sut .writeChunk (c -> c
153- .put ("timestamp" , new long []{1L , 2L })
154- .put ("symbol" , new String []{"A" , "B" , "C" })
155- .put ("price" , new double []{1.0 , 2.0 })))
155+ .put (ColumnName . of ( "timestamp" ) , new long []{1L , 2L })
156+ .put (ColumnName . of ( "symbol" ) , new String []{"A" , "B" , "C" })
157+ .put (ColumnName . of ( "price" ) , new double []{1.0 , 2.0 })))
156158 .isInstanceOf (IllegalArgumentException .class )
157159 .hasMessageContaining ("symbol" )
158160 .hasMessageContaining ("3 rows" )
0 commit comments