@@ -118,7 +118,8 @@ public static List<Object> parameters() {
118118 optional (14 , "all_nans" , DoubleType .get ()),
119119 optional (15 , "some_nans" , FloatType .get ()),
120120 optional (16 , "no_nans" , DoubleType .get ()),
121- optional (17 , "some_double_nans" , DoubleType .get ()));
121+ optional (17 , "some_double_nans" , DoubleType .get ()),
122+ optional (18 , "uuid_col" , Types .UUIDType .get ()));
122123
123124 private static final Types .StructType UNDERSCORE_STRUCT_FIELD_TYPE =
124125 Types .StructType .of (Types .NestedField .required (8 , "_int_field" , IntegerType .get ()));
@@ -136,7 +137,8 @@ public static List<Object> parameters() {
136137 optional (14 , "_all_nans" , Types .DoubleType .get ()),
137138 optional (15 , "_some_nans" , FloatType .get ()),
138139 optional (16 , "_no_nans" , Types .DoubleType .get ()),
139- optional (17 , "_some_double_nans" , Types .DoubleType .get ()));
140+ optional (17 , "_some_double_nans" , Types .DoubleType .get ()),
141+ optional (18 , "_uuid_col" , Types .UUIDType .get ()));
140142
141143 private static final String TOO_LONG_FOR_STATS_PARQUET ;
142144
@@ -151,6 +153,11 @@ public static List<Object> parameters() {
151153 private static final int INT_MIN_VALUE = 30 ;
152154 private static final int INT_MAX_VALUE = 79 ;
153155
156+ private static final UUID UUID_WITH_ZEROS =
157+ UUID .fromString ("00000000-0000-0000-0000-000000000000" );
158+ private static final UUID UUID_WITH_ONES =
159+ UUID .fromString ("11111111-1111-1111-1111-111111111111" );
160+
154161 private File orcFile = null ;
155162 private MessageType parquetSchema = null ;
156163 private BlockMetaData rowGroupMetadata = null ;
@@ -205,6 +212,9 @@ public void createOrcInputFile() throws IOException {
205212 structNotNull .setField ("_int_field" , INT_MIN_VALUE + i );
206213 record .setField ("_struct_not_null" , structNotNull ); // struct with int
207214
215+ record .setField (
216+ "_uuid_col" , (i % 3 == 0 ) ? UUID_WITH_ZEROS : (i % 3 == 1 ) ? UUID_WITH_ONES : null );
217+
208218 appender .add (record );
209219 }
210220 }
@@ -250,6 +260,9 @@ private void createParquetInputFile() throws IOException {
250260 structNotNull .put ("_int_field" , INT_MIN_VALUE + i );
251261 builder .set ("_struct_not_null" , structNotNull ); // struct with int
252262
263+ builder .set (
264+ "_uuid_col" , (i % 3 == 0 ) ? UUID_WITH_ZEROS : (i % 3 == 1 ) ? UUID_WITH_ONES : null );
265+
253266 appender .add (builder .build ());
254267 }
255268 }
@@ -988,6 +1001,18 @@ public void testTransformFilter() {
9881001 .isTrue ();
9891002 }
9901003
1004+ @ TestTemplate
1005+ public void testUUIDEq () {
1006+ assumeThat (format ).as ("Only valid for Parquet" ).isEqualTo (FileFormat .PARQUET );
1007+
1008+ boolean shouldRead = shouldRead (equal ("uuid_col" , UUID_WITH_ZEROS ));
1009+ assertThat (shouldRead ).as ("Should read: UUID value exists in row group" ).isTrue ();
1010+
1011+ UUID nonExistentUuid = UUID .fromString ("99999999-9999-9999-9999-999999999999" );
1012+ boolean shouldSkip = shouldRead (equal ("uuid_col" , nonExistentUuid ));
1013+ assertThat (shouldSkip ).as ("Should skip: UUID value does not exist in row group" ).isFalse ();
1014+ }
1015+
9911016 private boolean shouldRead (Expression expression ) {
9921017 return shouldRead (expression , true );
9931018 }
0 commit comments