@@ -119,7 +119,8 @@ public static List<Object> parameters() {
119119 optional (14 , "all_nans" , DoubleType .get ()),
120120 optional (15 , "some_nans" , FloatType .get ()),
121121 optional (16 , "no_nans" , DoubleType .get ()),
122- optional (17 , "some_double_nans" , DoubleType .get ()));
122+ optional (17 , "some_double_nans" , DoubleType .get ()),
123+ optional (18 , "uuid_col" , Types .UUIDType .get ()));
123124
124125 private static final Types .StructType UNDERSCORE_STRUCT_FIELD_TYPE =
125126 Types .StructType .of (Types .NestedField .required (8 , "_int_field" , IntegerType .get ()));
@@ -137,7 +138,8 @@ public static List<Object> parameters() {
137138 optional (14 , "_all_nans" , Types .DoubleType .get ()),
138139 optional (15 , "_some_nans" , FloatType .get ()),
139140 optional (16 , "_no_nans" , Types .DoubleType .get ()),
140- optional (17 , "_some_double_nans" , Types .DoubleType .get ()));
141+ optional (17 , "_some_double_nans" , Types .DoubleType .get ()),
142+ optional (18 , "_uuid_col" , Types .UUIDType .get ()));
141143
142144 private static final Schema VARIANT_SCHEMA =
143145 new Schema (
@@ -157,6 +159,11 @@ public static List<Object> parameters() {
157159 private static final int INT_MIN_VALUE = 30 ;
158160 private static final int INT_MAX_VALUE = 79 ;
159161
162+ private static final UUID UUID_WITH_ZEROS =
163+ UUID .fromString ("00000000-0000-0000-0000-000000000000" );
164+ private static final UUID UUID_WITH_ONES =
165+ UUID .fromString ("11111111-1111-1111-1111-111111111111" );
166+
160167 private File orcFile = null ;
161168 private MessageType parquetSchema = null ;
162169 private BlockMetaData rowGroupMetadata = null ;
@@ -211,6 +218,9 @@ public void createOrcInputFile() throws IOException {
211218 structNotNull .setField ("_int_field" , INT_MIN_VALUE + i );
212219 record .setField ("_struct_not_null" , structNotNull ); // struct with int
213220
221+ record .setField (
222+ "_uuid_col" , (i % 3 == 0 ) ? UUID_WITH_ZEROS : (i % 3 == 1 ) ? UUID_WITH_ONES : null );
223+
214224 appender .add (record );
215225 }
216226 }
@@ -248,6 +258,10 @@ private void createParquetInputFile() throws IOException {
248258 GenericRecord structNotNull = GenericRecord .create (UNDERSCORE_STRUCT_FIELD_TYPE );
249259 structNotNull .setField ("_int_field" , INT_MIN_VALUE + i );
250260 builder .setField ("_struct_not_null" , structNotNull ); // struct with int
261+
262+ builder .setField (
263+ "_uuid_col" , (i % 3 == 0 ) ? UUID_WITH_ZEROS : (i % 3 == 1 ) ? UUID_WITH_ONES : null );
264+
251265 records .add (builder );
252266 }
253267
@@ -1063,6 +1077,18 @@ public void testVariantFieldAllNullsNotNull() throws IOException {
10631077 }
10641078 }
10651079
1080+ @ TestTemplate
1081+ public void testUUIDEq () {
1082+ assumeThat (format ).as ("Only valid for Parquet" ).isEqualTo (FileFormat .PARQUET );
1083+
1084+ boolean shouldRead = shouldRead (equal ("uuid_col" , UUID_WITH_ZEROS ));
1085+ assertThat (shouldRead ).as ("Should read: UUID value exists in row group" ).isTrue ();
1086+
1087+ UUID nonExistentUuid = UUID .fromString ("99999999-9999-9999-9999-999999999999" );
1088+ boolean shouldSkip = shouldRead (equal ("uuid_col" , nonExistentUuid ));
1089+ assertThat (shouldSkip ).as ("Should skip: UUID value does not exist in row group" ).isFalse ();
1090+ }
1091+
10661092 private boolean shouldRead (Expression expression ) {
10671093 return shouldRead (expression , true );
10681094 }
0 commit comments