@@ -106,50 +106,53 @@ public void before() throws Exception {
106106 @ Test
107107 @ EnabledIfSystemProperty (named = "run.e2e.tests" , matches = "true" )
108108 public void testJavaWriteReadAppendTable () throws Exception {
109- Identifier identifier = identifier ("mixed_test_append_tablej" );
110- Schema schema =
111- Schema .newBuilder ()
112- .column ("id" , DataTypes .INT ())
113- .column ("name" , DataTypes .STRING ())
114- .column ("category" , DataTypes .STRING ())
115- .column ("value" , DataTypes .DOUBLE ())
116- .partitionKeys ("category" )
117- .option ("dynamic-partition-overwrite" , "false" )
118- .build ();
119-
120- catalog .createTable (identifier , schema , true );
121- Table table = catalog .getTable (identifier );
122- FileStoreTable fileStoreTable = (FileStoreTable ) table ;
123-
124- try (StreamTableWrite write = fileStoreTable .newWrite (commitUser );
125- InnerTableCommit commit = fileStoreTable .newCommit (commitUser )) {
126-
127- write .write (createRow4Cols (1 , "Apple" , "Fruit" , 1.5 ));
128- write .write (createRow4Cols (2 , "Banana" , "Fruit" , 0.8 ));
129- write .write (createRow4Cols (3 , "Carrot" , "Vegetable" , 0.6 ));
130- write .write (createRow4Cols (4 , "Broccoli" , "Vegetable" , 1.2 ));
131- write .write (createRow4Cols (5 , "Chicken" , "Meat" , 5.0 ));
132- write .write (createRow4Cols (6 , "Beef" , "Meat" , 8.0 ));
133-
134- commit .commit (0 , write .prepareCommit (true , 0 ));
109+ for (String format : Arrays .asList ("parquet" , "orc" , "avro" )) {
110+ Identifier identifier = identifier ("mixed_test_append_tablej_" + format );
111+ Schema schema =
112+ Schema .newBuilder ()
113+ .column ("id" , DataTypes .INT ())
114+ .column ("name" , DataTypes .STRING ())
115+ .column ("category" , DataTypes .STRING ())
116+ .column ("value" , DataTypes .DOUBLE ())
117+ .partitionKeys ("category" )
118+ .option ("dynamic-partition-overwrite" , "false" )
119+ .option ("file.format" , format )
120+ .build ();
121+
122+ catalog .createTable (identifier , schema , true );
123+ Table table = catalog .getTable (identifier );
124+ FileStoreTable fileStoreTable = (FileStoreTable ) table ;
125+
126+ try (StreamTableWrite write = fileStoreTable .newWrite (commitUser );
127+ InnerTableCommit commit = fileStoreTable .newCommit (commitUser )) {
128+
129+ write .write (createRow4Cols (1 , "Apple" , "Fruit" , 1.5 ));
130+ write .write (createRow4Cols (2 , "Banana" , "Fruit" , 0.8 ));
131+ write .write (createRow4Cols (3 , "Carrot" , "Vegetable" , 0.6 ));
132+ write .write (createRow4Cols (4 , "Broccoli" , "Vegetable" , 1.2 ));
133+ write .write (createRow4Cols (5 , "Chicken" , "Meat" , 5.0 ));
134+ write .write (createRow4Cols (6 , "Beef" , "Meat" , 8.0 ));
135+
136+ commit .commit (0 , write .prepareCommit (true , 0 ));
137+ }
138+
139+ List <Split > splits =
140+ new ArrayList <>(fileStoreTable .newSnapshotReader ().read ().dataSplits ());
141+ TableRead read = fileStoreTable .newRead ();
142+ List <String > res =
143+ getResult (
144+ read ,
145+ splits ,
146+ row -> DataFormatTestUtil .toStringNoRowKind (row , table .rowType ()));
147+ assertThat (res )
148+ .containsExactlyInAnyOrder (
149+ "1, Apple, Fruit, 1.5" ,
150+ "2, Banana, Fruit, 0.8" ,
151+ "3, Carrot, Vegetable, 0.6" ,
152+ "4, Broccoli, Vegetable, 1.2" ,
153+ "5, Chicken, Meat, 5.0" ,
154+ "6, Beef, Meat, 8.0" );
135155 }
136-
137- List <Split > splits =
138- new ArrayList <>(fileStoreTable .newSnapshotReader ().read ().dataSplits ());
139- TableRead read = fileStoreTable .newRead ();
140- List <String > res =
141- getResult (
142- read ,
143- splits ,
144- row -> DataFormatTestUtil .toStringNoRowKind (row , table .rowType ()));
145- assertThat (res )
146- .containsExactlyInAnyOrder (
147- "1, Apple, Fruit, 1.5" ,
148- "2, Banana, Fruit, 0.8" ,
149- "3, Carrot, Vegetable, 0.6" ,
150- "4, Broccoli, Vegetable, 1.2" ,
151- "5, Chicken, Meat, 5.0" ,
152- "6, Beef, Meat, 8.0" );
153156 }
154157
155158 @ Test
@@ -357,26 +360,28 @@ public void testPKDeletionVectorWriteMultiBatchRawConvertable() throws Exception
357360 @ Test
358361 @ EnabledIfSystemProperty (named = "run.e2e.tests" , matches = "true" )
359362 public void testReadPkTable () throws Exception {
360- Identifier identifier = identifier ("mixed_test_pk_tablep_parquet" );
361- Table table = catalog .getTable (identifier );
362- FileStoreTable fileStoreTable = (FileStoreTable ) table ;
363- List <Split > splits =
364- new ArrayList <>(fileStoreTable .newSnapshotReader ().read ().dataSplits ());
365- TableRead read = fileStoreTable .newRead ();
366- List <String > res =
367- getResult (
368- read ,
369- splits ,
370- row -> DataFormatTestUtil .toStringNoRowKind (row , table .rowType ()));
371- System .out .println ("Result: " + res );
372- assertThat (res )
373- .containsExactlyInAnyOrder (
374- "1, Apple, Fruit, 1.5" ,
375- "2, Banana, Fruit, 0.8" ,
376- "3, Carrot, Vegetable, 0.6" ,
377- "4, Broccoli, Vegetable, 1.2" ,
378- "5, Chicken, Meat, 5.0" ,
379- "6, Beef, Meat, 8.0" );
363+ for (String format : Arrays .asList ("parquet" , "orc" , "avro" )) {
364+ Identifier identifier = identifier ("mixed_test_pk_tablep_" + format );
365+ Table table = catalog .getTable (identifier );
366+ FileStoreTable fileStoreTable = (FileStoreTable ) table ;
367+ List <Split > splits =
368+ new ArrayList <>(fileStoreTable .newSnapshotReader ().read ().dataSplits ());
369+ TableRead read = fileStoreTable .newRead ();
370+ List <String > res =
371+ getResult (
372+ read ,
373+ splits ,
374+ row -> DataFormatTestUtil .toStringNoRowKind (row , table .rowType ()));
375+ System .out .println ("Result: " + res );
376+ assertThat (res )
377+ .containsExactlyInAnyOrder (
378+ "1, Apple, Fruit, 1.5" ,
379+ "2, Banana, Fruit, 0.8" ,
380+ "3, Carrot, Vegetable, 0.6" ,
381+ "4, Broccoli, Vegetable, 1.2" ,
382+ "5, Chicken, Meat, 5.0" ,
383+ "6, Beef, Meat, 8.0" );
384+ }
380385 }
381386
382387 // Helper method from TableTestBase
0 commit comments