You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/05/27 03:57:43 UTC
[GitHub] [incubator-iceberg] rdblue opened a new pull request #1070: Update metrics tests to use Iceberg generics
rdblue opened a new pull request #1070:
URL: https://github.com/apache/incubator-iceberg/pull/1070
This updates `TestMetrics` to use Iceberg generic records for its test cases. This is to avoid creating an Avro writer for ORC just to make the tests work.
Using Iceberg generics for this test required moving the generic record classes to core so they are available to `TestMetrics` in core. Reader and writer classes for Avro are also moved to core.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #1070: Update metrics tests to use Iceberg generics
Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #1070:
URL: https://github.com/apache/incubator-iceberg/pull/1070#discussion_r431306280
##########
File path: core/src/test/java/org/apache/iceberg/TestMetrics.java
##########
@@ -95,59 +88,57 @@
optional(8, "dateCol", DateType.get()),
required(9, "timeCol", TimeType.get()),
required(10, "timestampCol", TimestampType.withoutZone()),
- optional(11, "uuidCol", UUIDType.get()),
- required(12, "fixedCol", FixedType.ofLength(4)),
- required(13, "binaryCol", BinaryType.get())
+ required(11, "fixedCol", FixedType.ofLength(4)),
Review comment:
UUID columns aren't currently supported in the Parquet writers for Iceberg generics. Rather than adding that support here, I thought it was better to remove it. We can add it back later, but I don't want to block ORC metrics on it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [incubator-iceberg] edgarRd commented on a change in pull request #1070: Update metrics tests to use Iceberg generics
Posted by GitBox <gi...@apache.org>.
edgarRd commented on a change in pull request #1070:
URL: https://github.com/apache/incubator-iceberg/pull/1070#discussion_r430790459
##########
File path: core/src/test/java/org/apache/iceberg/TestMetrics.java
##########
@@ -95,59 +88,57 @@
optional(8, "dateCol", DateType.get()),
required(9, "timeCol", TimeType.get()),
required(10, "timestampCol", TimestampType.withoutZone()),
- optional(11, "uuidCol", UUIDType.get()),
- required(12, "fixedCol", FixedType.ofLength(4)),
- required(13, "binaryCol", BinaryType.get())
+ required(11, "fixedCol", FixedType.ofLength(4)),
Review comment:
Sorry if I'm missing some context, but why is the `uuidCol` dropped?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [incubator-iceberg] rdsr commented on a change in pull request #1070: Update metrics tests to use Iceberg generics
Posted by GitBox <gi...@apache.org>.
rdsr commented on a change in pull request #1070:
URL: https://github.com/apache/incubator-iceberg/pull/1070#discussion_r430790685
##########
File path: core/src/test/java/org/apache/iceberg/TestMetrics.java
##########
@@ -95,59 +88,57 @@
optional(8, "dateCol", DateType.get()),
required(9, "timeCol", TimeType.get()),
required(10, "timestampCol", TimestampType.withoutZone()),
- optional(11, "uuidCol", UUIDType.get()),
- required(12, "fixedCol", FixedType.ofLength(4)),
- required(13, "binaryCol", BinaryType.get())
+ required(11, "fixedCol", FixedType.ofLength(4)),
+ required(12, "binaryCol", BinaryType.get())
);
- private final UUID uuid = UUID.randomUUID();
- private final GenericFixed fixed = new GenericData.Fixed(
- org.apache.avro.Schema.createFixed("fixedCol", null, null, 4),
- "abcd".getBytes(StandardCharsets.UTF_8));
+ private final byte[] fixed = "abcd".getBytes(StandardCharsets.UTF_8);
public abstract Metrics getMetrics(InputFile file);
- public abstract File writeRecords(Schema schema, Record... records) throws IOException;
+ public abstract InputFile writeRecords(Schema schema, Record... records) throws IOException;
- public abstract File writeRecords(Schema schema, Map<String, String> properties, GenericData.Record... records)
+ public abstract InputFile writeRecordsWithSmallRowGroups(Schema schema, Record... records)
throws IOException;
- public abstract int splitCount(File parquetFile) throws IOException;
+ public abstract int splitCount(InputFile parquetFile) throws IOException;
+
+ public boolean supportsSmallRowGroups() {
+ return false;
+ }
@Test
public void testMetricsForRepeatedValues() throws IOException {
Review comment:
is the test name misleading? Seems like we. are testing for multiple records, not repeated values in maps and lists
##########
File path: data/src/test/java/org/apache/iceberg/parquet/TestParquetMetrics.java
##########
@@ -0,0 +1,93 @@
+/*
+ * 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.parquet;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+import java.util.UUID;
+import org.apache.iceberg.FileFormat;
+import org.apache.iceberg.Files;
+import org.apache.iceberg.Metrics;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.TableProperties;
+import org.apache.iceberg.TestMetrics;
+import org.apache.iceberg.data.Record;
+import org.apache.iceberg.data.parquet.GenericParquetWriter;
+import org.apache.iceberg.io.FileAppender;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.apache.iceberg.relocated.com.google.common.collect.Lists;
+import org.apache.parquet.hadoop.ParquetFileReader;
+import org.junit.Rule;
+import org.junit.rules.TemporaryFolder;
+
+/**
Review comment:
nit: seems like comment is not adding anything more
##########
File path: core/src/test/java/org/apache/iceberg/TestMetrics.java
##########
@@ -95,59 +88,57 @@
optional(8, "dateCol", DateType.get()),
required(9, "timeCol", TimeType.get()),
required(10, "timestampCol", TimestampType.withoutZone()),
- optional(11, "uuidCol", UUIDType.get()),
- required(12, "fixedCol", FixedType.ofLength(4)),
- required(13, "binaryCol", BinaryType.get())
+ required(11, "fixedCol", FixedType.ofLength(4)),
+ required(12, "binaryCol", BinaryType.get())
);
- private final UUID uuid = UUID.randomUUID();
- private final GenericFixed fixed = new GenericData.Fixed(
- org.apache.avro.Schema.createFixed("fixedCol", null, null, 4),
- "abcd".getBytes(StandardCharsets.UTF_8));
+ private final byte[] fixed = "abcd".getBytes(StandardCharsets.UTF_8);
public abstract Metrics getMetrics(InputFile file);
- public abstract File writeRecords(Schema schema, Record... records) throws IOException;
+ public abstract InputFile writeRecords(Schema schema, Record... records) throws IOException;
- public abstract File writeRecords(Schema schema, Map<String, String> properties, GenericData.Record... records)
+ public abstract InputFile writeRecordsWithSmallRowGroups(Schema schema, Record... records)
throws IOException;
- public abstract int splitCount(File parquetFile) throws IOException;
+ public abstract int splitCount(InputFile parquetFile) throws IOException;
+
+ public boolean supportsSmallRowGroups() {
+ return false;
+ }
@Test
public void testMetricsForRepeatedValues() throws IOException {
Review comment:
is the test name misleading? Seems like we are testing for multiple records, not repeated values in maps and lists
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [incubator-iceberg] edgarRd commented on a change in pull request #1070: Update metrics tests to use Iceberg generics
Posted by GitBox <gi...@apache.org>.
edgarRd commented on a change in pull request #1070:
URL: https://github.com/apache/incubator-iceberg/pull/1070#discussion_r431343636
##########
File path: core/src/test/java/org/apache/iceberg/TestMetrics.java
##########
@@ -95,59 +88,57 @@
optional(8, "dateCol", DateType.get()),
required(9, "timeCol", TimeType.get()),
required(10, "timestampCol", TimestampType.withoutZone()),
- optional(11, "uuidCol", UUIDType.get()),
- required(12, "fixedCol", FixedType.ofLength(4)),
- required(13, "binaryCol", BinaryType.get())
+ required(11, "fixedCol", FixedType.ofLength(4)),
Review comment:
SGTM. Thanks for the context.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #1070: Update metrics tests to use Iceberg generics
Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #1070:
URL: https://github.com/apache/incubator-iceberg/pull/1070#discussion_r431305168
##########
File path: core/src/test/java/org/apache/iceberg/TestMetrics.java
##########
@@ -95,59 +88,57 @@
optional(8, "dateCol", DateType.get()),
required(9, "timeCol", TimeType.get()),
required(10, "timestampCol", TimestampType.withoutZone()),
- optional(11, "uuidCol", UUIDType.get()),
- required(12, "fixedCol", FixedType.ofLength(4)),
- required(13, "binaryCol", BinaryType.get())
+ required(11, "fixedCol", FixedType.ofLength(4)),
+ required(12, "binaryCol", BinaryType.get())
);
- private final UUID uuid = UUID.randomUUID();
- private final GenericFixed fixed = new GenericData.Fixed(
- org.apache.avro.Schema.createFixed("fixedCol", null, null, 4),
- "abcd".getBytes(StandardCharsets.UTF_8));
+ private final byte[] fixed = "abcd".getBytes(StandardCharsets.UTF_8);
public abstract Metrics getMetrics(InputFile file);
- public abstract File writeRecords(Schema schema, Record... records) throws IOException;
+ public abstract InputFile writeRecords(Schema schema, Record... records) throws IOException;
- public abstract File writeRecords(Schema schema, Map<String, String> properties, GenericData.Record... records)
+ public abstract InputFile writeRecordsWithSmallRowGroups(Schema schema, Record... records)
throws IOException;
- public abstract int splitCount(File parquetFile) throws IOException;
+ public abstract int splitCount(InputFile parquetFile) throws IOException;
+
+ public boolean supportsSmallRowGroups() {
+ return false;
+ }
@Test
public void testMetricsForRepeatedValues() throws IOException {
Review comment:
I think it sounds like we were testing repeated values in maps and lists.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org