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 2021/08/13 11:34:12 UTC
[GitHub] [iceberg] hililiwei opened a new pull request #2968: Flink:Add Flink Scala Api(#2861)
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: issues-unsubscribe@iceberg.apache.org
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] [iceberg] hililiwei closed pull request #2968: Flink:Add Flink Scala Api
Posted by GitBox <gi...@apache.org>.
hililiwei closed pull request #2968:
URL: https://github.com/apache/iceberg/pull/2968
--
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: issues-unsubscribe@iceberg.apache.org
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