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


##########
parquet-column/src/test/java/org/apache/parquet/column/values/alp/AlpAdversarialTest.java:
##########
@@ -0,0 +1,398 @@
+/*
+ * 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.parquet.column.values.alp;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertThrows;

Review Comment:
   Please use AssertJ `assertThatThrownBy`. The test guide disallows JUnit 
assertion helpers. It seems that CI is complaining about the same thing:
   
   ```
   [ERROR] Banned imports detected in TEST code:
   [ERROR] 
   [ERROR] Reason: Use JUnit 5 (org.junit.jupiter.*) and AssertJ instead of 
JUnit 4
   [ERROR]      in 
file:///home/runner/work/parquet-java/parquet-java/parquet-hadoop/src/test/java/org/apache/parquet/hadoop/TestInputFormatFileStatusReuse.java
   [ERROR]              static org.junit.Assert.assertEquals    (Line: 20, 
Matched by: org.junit.**)
   [ERROR]              static org.junit.Assert.assertSame      (Line: 21, 
Matched by: org.junit.**)
   [ERROR]              static org.junit.Assert.assertTrue      (Line: 22, 
Matched by: org.junit.**)
   [ERROR]              org.junit.Rule                          (Line: 50, 
Matched by: org.junit.**)
   [ERROR]              org.junit.Test                          (Line: 51, 
Matched by: org.junit.**)
   [ERROR]              org.junit.rules.TemporaryFolder         (Line: 52, 
Matched by: org.junit.**)
   ```



##########
parquet-column/src/test/java/org/apache/parquet/column/values/factory/DefaultValuesWriterFactoryTest.java:
##########
@@ -631,6 +668,50 @@ private void 
testFloatingPoint_WithByteStreamSplitAndDictionary(
         PlainValuesWriter.class);
   }
 
+  private void testFloatingPoint_WithAlp(
+      PrimitiveTypeName typeName, WriterVersion writerVersion, Class<? extends 
ValuesWriter> alpWriterClass) {
+    // Cross-column ALP without a dictionary: the ALP writer is produced 
directly.
+    doTestValueWriter(
+        createColumnDescriptor(typeName),
+        ParquetProperties.builder()
+            .withWriterVersion(writerVersion)
+            .withDictionaryEncoding(false)
+            .withAlp()
+            .build(),
+        alpWriterClass);
+    // Cross-column ALP with a dictionary: the ALP writer is the dictionary's 
fallback.
+    doTestValueWriter(
+        createColumnDescriptor(typeName),
+        ParquetProperties.builder()
+            .withWriterVersion(writerVersion)
+            .withAlp()
+            .build(),
+        DictionaryValuesWriter.class,
+        alpWriterClass);
+    // Per-column ALP: only colA opts in, colB keeps the plain fallback.
+    ParquetProperties properties = ParquetProperties.builder()
+        .withWriterVersion(writerVersion)
+        .withDictionaryEncoding(false)
+        .withAlp("colA")
+        .build();
+    doTestValueWriter(createColumnDescriptor(typeName, "colA"), properties, 
alpWriterClass);
+    doTestValueWriter(createColumnDescriptor(typeName, "colB"), properties, 
PlainValuesWriter.class);
+  }
+
+  private void testAlpTakesPrecedenceOverByteStreamSplit(
+      PrimitiveTypeName typeName, WriterVersion writerVersion, Class<? extends 
ValuesWriter> alpWriterClass) {
+    // When both ALP and byte-stream-split are enabled the factory prefers ALP.

Review Comment:
   This is obsolete. Production validation now rejects ALP and 
BYTE_STREAM_SPLIT on the same column.



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