hililiwei opened a new pull request #2968:
URL: https://github.com/apache/iceberg/pull/2968
Add flink scala api.
use case:
```
import org.apache.flink.streaming.api.scala.{DataStream,
StreamExecutionEnvironment}
import org.apache.flink.table.data.RowData
import org.apache.iceberg.flink.TableLoader
import org.apache.iceberg.flink.scala.sink.FlinkSink
import org.apache.iceberg.flink.scala.source.FlinkSource
import org.apache.iceberg.flink.scala.source.FlinkSource._
object TestIcebergScalaApi {
def main(args: Array[String]): Unit = {
val env = StreamExecutionEnvironment.getExecutionEnvironment
val tableLoader1 =
TableLoader.fromHadoopTable("hdfs:///iceberg/hadoop_catalog/iceberg_db/sample")
val batch: DataStream[RowData] = FlinkSource
.forRowData.env(env)
.tableLoader(tableLoader1)
.streaming(false).build()
val tableLoader2 =
TableLoader.fromHadoopTable("hdfs:///iceberg/hadoop_catalog/iceberg_db/sample2")
FlinkSink.forRowData(batch)
.tableLoader(tableLoader2)
.overwrite(true)
.build()
env.execute("Test Iceberg Batch Read")
}
}
```
--
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]