wgtmac commented on code in PR #3699:
URL: https://github.com/apache/parquet-java/pull/3699#discussion_r3691851732


##########
parquet-column/src/main/java/org/apache/parquet/schema/PrimitiveType.java:
##########
@@ -648,6 +662,20 @@ public PrimitiveType(
     this.columnOrder = requireValidColumnOrder(columnOrder);
   }
 
+  /**
+   * Whether a {@code FLOAT} or {@code DOUBLE} column with no explicit column 
order should default to
+   * IEEE 754 total order. This is skipped when a logical type annotation is 
present but does not
+   * accept IEEE 754 total order (e.g. an unknown annotation), so the type 
stays constructible with
+   * the type-defined fallback.
+   */
+  private boolean defaultsToIeee754TotalOrder(PrimitiveTypeName primitive) {
+    if (primitive != PrimitiveTypeName.FLOAT && primitive != 
PrimitiveTypeName.DOUBLE) {

Review Comment:
   Is this correct? FLOAT16 has FLBA primitive type which will be rejected 
here. Should we pass LogicalTypeAnnotation explicitly instead of calling 
`getLogicalTypeAnnotation()` so these logics are in a single place?



##########
parquet-column/src/test/java/org/apache/parquet/column/statistics/TestStatistics.java:
##########
@@ -775,7 +776,9 @@ private void testBuilder(PrimitiveType type, Object min, 
byte[] minBytes, Object
 
   @Test
   public void testSpecBuilderForFloat() {
-    PrimitiveType type = Types.required(FLOAT).named("test_float");
+    // NaN/+-0 read semantics are specific to type-defined order (float now 
defaults to IEEE 754).

Review Comment:
   There are so many similar verbose comments. Should we just remove them? I 
believe it is clear when test cases have set explicit column orders.



-- 
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