rdblue commented on a change in pull request #1972: URL: https://github.com/apache/iceberg/pull/1972#discussion_r550269126
########## File path: site/docs/beam.md ########## @@ -0,0 +1,39 @@ +<!-- + - 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. + --> + +# Apache Beam + +!!! Warning + The Beam API is experimental and in early alpha stage + +## Write records + +When sinking Avro files to a distributed file system using `FileIO`, we can catch rely the filenames downstream. We append these filenames to an Iceberg table incrementally. + +```java +final String hiveMetastoreUrl = "thrift://localhost:9083/default"; +final FileIO.Write<Void, GenericRecord> avroFileIO = FileIO.<GenericRecord>write() + .via(AvroIO.sink(avroSchema)) + .to("gs://.../../") + .withSuffix(".avro"); Review comment: The problem with converting Avro to Iceberg is that there is no guarantee that the field IDs are assigned consistently (see [the Field IDs section for Avro](http://iceberg.apache.org/spec/#avro)). If the ID annotations aren't present, they are reassigned but that depends on the structure of the schema. To safely write Avro for an Iceberg table, you should always convert from the table schema to an Avro schema so that the IDs are correct and match the table. ---------------------------------------------------------------- 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]
