参考:https://iceberg.apache.org/docs/latest/flink/#reading-with-datastream
2.代码org.apache.flink flink-java 1.12.0 org.apache.flink flink-streaming-java_2.12 1.12.0 org.apache.flink flink-clients_2.12 1.12.0 org.apache.iceberg iceberg-core 0.13.1 org.apache.iceberg iceberg-flink-runtime 0.12.1
public class ReadIceberg {
public static void main(String[] args) throws Exception {
//创建flink执行环境
StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(new Configuration());
TableLoader tableLoader = TableLoader.fromHadoopTable("hdfs://hadoop01:9000/warehouse/iceberg/ods_db/test");
DataStream batch = FlinkSource.forRowData()
.env(env)
.tableLoader(tableLoader)
.streaming(false)
.build();
//打印
batch.print();
//提交任务
env.execute("Test Iceberg Batch Read");
}
}



