wombatu-kun commented on code in PR #16621:
URL: https://github.com/apache/iceberg/pull/16621#discussion_r3432485393


##########
parquet/src/test/java/org/apache/iceberg/parquet/TestParquetFilters.java:
##########
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg.parquet;
+
+import static org.apache.iceberg.expressions.Expressions.equal;
+import static org.apache.iceberg.expressions.Expressions.not;
+import static org.apache.iceberg.types.Types.NestedField.optional;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.math.BigDecimal;
+import java.util.UUID;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.expressions.Expression;
+import org.apache.iceberg.types.TypeUtil;
+import org.apache.iceberg.types.Types;
+import org.apache.iceberg.util.DecimalUtil;
+import org.apache.iceberg.util.UUIDUtil;
+import org.apache.parquet.filter2.compat.FilterCompat;
+import org.apache.parquet.filter2.compat.FilterCompat.FilterPredicateCompat;
+import org.apache.parquet.filter2.predicate.FilterPredicate;
+import org.apache.parquet.filter2.predicate.Operators;
+import org.apache.parquet.io.api.Binary;
+import org.apache.parquet.schema.LogicalTypeAnnotation;
+import org.apache.parquet.schema.MessageType;
+import org.apache.parquet.schema.PrimitiveType.PrimitiveTypeName;
+import org.junit.jupiter.api.Test;
+

Review Comment:
   The new tests assert only the converted `FilterPredicate`'s column type and 
value, and the FIXED/BINARY cases rebuild the expected bytes from the same 
`DecimalUtil.toReusedFixLengthBytes(...)` / `unscaledValue().toByteArray()` 
calls the production code uses, so a wrong physical-type pick or byte-order 
slip would still pass. None go through `filterIds` (`TestParquet.java:482`), 
whose own comment notes it is "the only read path that runs ParquetFilters".
   
   Add an end-to-end read-with-filter test that writes decimal and UUID rows 
and asserts the returned ids, mirroring the same-file precedent from #16619 
(`timestampNanoFilterRespectsNanoseconds`, `TestParquet.java:392`). Cover at 
least a negative decimal, a FIXED-backed `decimal(>18)`, and an ordering 
predicate (lt/gt), where sign extension and byte order are most likely to break.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to