rdblue commented on a change in pull request #1972: URL: https://github.com/apache/iceberg/pull/1972#discussion_r549472232
########## 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: This would work if the Avro schema passed to the sink were created from the Iceberg table schema because that sets the field IDs correctly. But I think that's not very obvious to users, so I think it would be better to eventually have an Iceberg sink that uses the Iceberg schema directly like Spark and Flink do. ---------------------------------------------------------------- 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]
