rdblue commented on a change in pull request #1972:
URL: https://github.com/apache/iceberg/pull/1972#discussion_r550269735



##########
File path: beam/src/test/java/org/apache/iceberg/beam/IcebergIOTest.java
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed 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.beam;
+
+import org.apache.avro.Schema;
+import org.apache.avro.generic.GenericData;
+import org.apache.avro.generic.GenericRecord;
+import org.apache.beam.sdk.Pipeline;
+import org.apache.beam.sdk.coders.AvroCoder;
+import org.apache.beam.sdk.coders.StringUtf8Coder;
+import org.apache.beam.sdk.io.AvroIO;
+import org.apache.beam.sdk.io.FileIO;
+import org.apache.beam.sdk.io.WriteFilesResult;
+import org.apache.beam.sdk.options.PipelineOptions;
+import org.apache.beam.sdk.options.PipelineOptionsFactory;
+import org.apache.beam.sdk.testing.TestPipeline;
+import org.apache.beam.sdk.testing.TestStream;
+import org.apache.beam.sdk.transforms.Create;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.transforms.windowing.FixedWindows;
+import org.apache.beam.sdk.transforms.windowing.Window;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.TimestampedValue;
+import org.apache.iceberg.avro.AvroSchemaUtil;
+import org.apache.iceberg.catalog.TableIdentifier;
+import org.joda.time.Duration;
+import org.joda.time.Instant;
+import org.junit.Rule;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class IcebergIOTest {
+    private static final List<String> SENTENCES =
+        Arrays.asList(
+            "Beam window 1 1",
+            "Beam window 1 2",
+            "Beam window 1 3",
+            "Beam window 1 4",
+            "Beam window 2 1",
+            "Beam window 2 2");
+    private static final Instant START_TIME = new Instant(0);
+
+    private static final List<String> FIRST_WIN_WORDS = SENTENCES.subList(0, 
4);
+    private static final List<String> SECOND_WIN_WORDS = SENTENCES.subList(4, 
6);
+    private static final Duration WINDOW_DURATION = 
Duration.standardMinutes(1);
+
+    @Rule
+    public final transient TestPipeline pipeline = TestPipeline.create();
+    final String hiveMetastoreUrl = "thrift://localhost:9083/default";
+
+    private static final PipelineOptions options = 
TestPipeline.testingPipelineOptions();
+
+    private static final String stringSchema = "{\n" +

Review comment:
       Okay, so the initial conversion to Iceberg assigns some IDs, then you 
pass that Iceberg schema into the source. The IDs are reassigned to ensure 
consistency when a table is created, and you're probably converting that table 
schema back to Iceberg to configure the Avro writer?




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to