Jiayi-Wang-db commented on code in PR #3699:
URL: https://github.com/apache/parquet-java/pull/3699#discussion_r3693133117


##########
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:
   Thanks for catching this. Refactored into a single static 
defaultColumnOrder(primitive, originalType, logicalTypeAnnotation) that 
recognizes FLOAT16 .



##########
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:
   Removed.



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