3030import org .apache .paimon .types .DataTypes ;
3131import org .apache .paimon .types .RowType ;
3232
33+ import dev .vortex .api .DType ;
3334import org .junit .jupiter .api .BeforeAll ;
3435
3536import java .math .BigDecimal ;
@@ -47,9 +48,12 @@ protected VortexFileFormatReadWriteTest() {
4748 super ("vortex" );
4849 }
4950
51+ private static boolean fixedSizeListSupported ;
52+
5053 @ BeforeAll
5154 static void checkNativeLibrary () {
5255 assumeTrue (isNativeAvailable (), "Vortex native library not available, skipping tests" );
56+ fixedSizeListSupported = isFixedSizeListSupported ();
5357 }
5458
5559 private static boolean isNativeAvailable () {
@@ -61,6 +65,15 @@ private static boolean isNativeAvailable() {
6165 }
6266 }
6367
68+ private static boolean isFixedSizeListSupported () {
69+ try {
70+ DType .newFixedSizeList (DType .newInt (false ), 2 , false );
71+ return true ;
72+ } catch (Throwable t ) {
73+ return false ;
74+ }
75+ }
76+
6477 @ Override
6578 public boolean supportNestedReadPruning () {
6679 return false ;
@@ -109,8 +122,10 @@ protected RowType rowTypeForFullTypesTest() {
109122 1 ,
110123 "double1" ,
111124 DataTypes .DOUBLE ().notNull (),
112- "nested row double field 1" ))))
113- .field ("floatVector" , DataTypes .VECTOR (3 , DataTypes .FLOAT ()));
125+ "nested row double field 1" ))));
126+ if (fixedSizeListSupported ) {
127+ builder .field ("floatVector" , DataTypes .VECTOR (3 , DataTypes .FLOAT ()));
128+ }
114129
115130 RowType rowType = builder .build ();
116131 if (ThreadLocalRandom .current ().nextBoolean ()) {
@@ -122,26 +137,32 @@ protected RowType rowTypeForFullTypesTest() {
122137 @ Override
123138 protected GenericRow expectedRowForFullTypesTest () {
124139 List <Object > values =
125- Arrays .asList (
126- 1 ,
127- fromString ("name" ),
128- 5.26D ,
129- new GenericArray (new Object [] {fromString ("123" ), fromString ("456" )}),
130- new GenericArray (new Object [] {123 , 456 }),
131- true ,
132- (byte ) 3 ,
133- (short ) 6 ,
134- 12304L ,
135- new byte [] {1 , 5 , 2 },
136- Timestamp .fromMicros (123123123 ),
137- Timestamp .fromEpochMillis (123123123 ),
138- 2456 ,
139- Decimal .fromBigDecimal (new BigDecimal ("0.22" ), 2 , 2 ),
140- Decimal .fromBigDecimal (new BigDecimal ("12312455.22" ), 38 , 2 ),
141- Decimal .fromBigDecimal (new BigDecimal ("12455.1" ), 10 , 1 ),
142- new GenericArray (
143- new Object [] {GenericRow .of (1 , 0.1D ), GenericRow .of (2 , 0.2D )}),
144- BinaryVector .fromPrimitiveArray (new float [] {1.0f , 2.0f , 3.0f }));
140+ new java .util .ArrayList <>(
141+ Arrays .asList (
142+ 1 ,
143+ fromString ("name" ),
144+ 5.26D ,
145+ new GenericArray (
146+ new Object [] {fromString ("123" ), fromString ("456" )}),
147+ new GenericArray (new Object [] {123 , 456 }),
148+ true ,
149+ (byte ) 3 ,
150+ (short ) 6 ,
151+ 12304L ,
152+ new byte [] {1 , 5 , 2 },
153+ Timestamp .fromMicros (123123123 ),
154+ Timestamp .fromEpochMillis (123123123 ),
155+ 2456 ,
156+ Decimal .fromBigDecimal (new BigDecimal ("0.22" ), 2 , 2 ),
157+ Decimal .fromBigDecimal (new BigDecimal ("12312455.22" ), 38 , 2 ),
158+ Decimal .fromBigDecimal (new BigDecimal ("12455.1" ), 10 , 1 ),
159+ new GenericArray (
160+ new Object [] {
161+ GenericRow .of (1 , 0.1D ), GenericRow .of (2 , 0.2D )
162+ })));
163+ if (fixedSizeListSupported ) {
164+ values .add (BinaryVector .fromPrimitiveArray (new float [] {1.0f , 2.0f , 3.0f }));
165+ }
145166 return GenericRow .of (values .toArray ());
146167 }
147168}
0 commit comments