RussellSpitzer commented on a change in pull request #3723:
URL: https://github.com/apache/iceberg/pull/3723#discussion_r771504231



##########
File path: 
spark/v3.2/spark/src/test/java/org/apache/iceberg/spark/data/TestParquetReader.java
##########
@@ -0,0 +1,157 @@
+/*
+ * 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.data;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.apache.iceberg.spark.SparkSessionCatalog;
+import org.apache.iceberg.spark.SparkTestBaseWithCatalog;
+import org.apache.iceberg.spark.actions.SparkActions;
+import org.apache.spark.sql.SparkSession;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+public class TestParquetReader extends SparkTestBaseWithCatalog {
+  private static SparkSession spark = null;
+  private static String catalogName = "spark_catalog";
+  private static String implementation = SparkSessionCatalog.class.getName();
+  private static Map<String, String> config = ImmutableMap.of(
+      "type", "hive",
+      "default-namespace", "default",
+      "parquet-enabled", "true",
+      "cache-enabled", "false"
+  );
+
+  @Rule
+  public TemporaryFolder temp = new TemporaryFolder();
+
+  public TestParquetReader() {
+    super(catalogName, implementation, config);
+    spark.sessionState().catalogManager().catalog(catalogName);
+  }
+
+  @BeforeClass
+  public static void startSpark() {
+    TestParquetReader.spark = SparkSession.builder().master("local[2]")
+            .config("spark.sql.parquet.writeLegacyFormat", true)
+            .getOrCreate();
+    spark.sessionState().catalogManager().catalog("spark_catalog");
+  }
+
+  @AfterClass
+  public static void stopSpark() {
+    SparkSession currentSpark = TestParquetReader.spark;
+    TestParquetReader.spark = null;
+    currentSpark.stop();
+  }
+
+  @Test

Review comment:
       ```parquet-tools meta 
/var/folders/yl/6cwgks7919s1td2mfdq86cbm0000gn/T/junit5012408329488933688/junit3620601311176219234
   file:        
file:/var/folders/yl/6cwgks7919s1td2mfdq86cbm0000gn/T/junit5012408329488933688/junit3620601311176219234/part-00000-14bc6af7-9778-42c9-9fb2-703938925eb9-c000.snappy.parquet
   creator:     parquet-mr version 1.12.2 (build 
77e30c8093386ec52c3cfa6c34b7ef3321322c94)
   extra:       org.apache.spark.version = 3.2.0
   extra:       org.apache.spark.sql.parquet.row.metadata = 
{"type":"struct","fields":[{"name":"col1","type":{"type":"array","elementType":{"type":"struct","fields":[{"name":"col2","type":"integer","nullable":true,"metadata":{}}]},"containsNull":true},"nullable":false,"metadata":{}}]}
   
   file schema: spark_schema
   
--------------------------------------------------------------------------------
   col1:        REQUIRED F:1
   .list:       REPEATED F:1
   ..element:   OPTIONAL F:1
   ...col2:     OPTIONAL INT32 R:1 D:3
   
   row group 1: RC:1 TS:40 OFFSET:4
   
--------------------------------------------------------------------------------
   col1:
   .list:
   ..element:
   ...col2:      INT32 SNAPPY DO:0 FPO:4 SZ:42/40/0.95 VC:1 ENC:RLE,PLAIN 
ST:[min: 12345, max: 12345, num_nulls: 0]```




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