Copilot commented on code in PR #12901:
URL: https://github.com/apache/gluten/pull/12901#discussion_r4106252542


##########
backends-velox/src-iceberg/test/java/org/apache/iceberg/spark/source/IcebergWriteExecCapacityTest.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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.spark.source;
+
+import org.apache.gluten.execution.IcebergWriteExec;
+
+import org.apache.iceberg.Table;
+import org.apache.iceberg.TableProperties;
+import org.apache.iceberg.spark.SparkWriteConf;
+import org.junit.Test;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.CALLS_REAL_METHODS;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public class IcebergWriteExecCapacityTest {
+  @Test
+  public void unitlessTablePropertiesDefaultToBytes() throws Exception {
+    for (String value : new String[] {"0", "1024", " 1024 "}) {
+      assertTableProperties(value, value.trim() + "B");
+    }
+  }
+
+  @Test
+  public void explicitTablePropertyUnitsArePreserved() throws Exception {
+    for (String value : new String[] {"1024B", "1KB", "1MB", "1mb", " 1 MB "}) 
{
+      assertTableProperties(value, value.trim());
+    }
+  }
+
+  @Test
+  public void absentTablePropertiesUseByteDefaults() throws Exception {
+    IcebergWriteExec exec = createExec(new HashMap<>(), 8192L);
+    assertEquals(
+        TableProperties.PARQUET_PAGE_SIZE_BYTES_DEFAULT + "B", 
exec.getParquetPageSizeBytes());
+    assertEquals(TableProperties.PARQUET_DICT_SIZE_BYTES_DEFAULT + "B", 
exec.getDictSizeBytes());

Review Comment:
   This Java test calls `getParquetPageSizeBytes()` (and the other `get*` 
helpers below) directly even though they are declared `protected` on 
`org.apache.gluten.execution.IcebergWriteExec`. Because this test is in the 
unrelated `org.apache.iceberg.spark.source` package and does not subclass the 
trait, these calls are not accessible from Java and the test source will fail 
to compile. Invoke the helpers through reflection or add a test-only 
accessor/subclass in the declaring package.



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