txdong-sz opened a new issue #2225:
URL: https://github.com/apache/iceberg/issues/2225
my code is like this:
TableLoader tableLoader =
TableLoader.fromHadoopTable("cosn://txdongbf-1258344701/hdfs/iceberg_db/play3_data");
List<org.apache.iceberg.expressions.Expression> filters = new
ArrayList<>();
LocalDate tody = LocalDate.now();
LocalTime time = LocalTime.of(0, 0);
LocalDateTime ldt1 = LocalDateTime.of(tody,time);
ZonedDateTime zdt1 =
ldt1.atZone(OffsetDateTime.now().getOffset());
LocalDate yes = LocalDate.now().minusDays(1);
LocalDateTime ldt2 = LocalDateTime.of(yes,time);
ZonedDateTime zdt2 =
ldt2.atZone(OffsetDateTime.now().getOffset());
DateTimeFormatter dtf = DateTimeFormatter.ISO_DATE_TIME;
String starttime = dtf.format(zdt2);
String endtime = dtf.format(zdt1);
filters.add(Expressions.greaterThan("ftime", starttime));
filters.add(Expressions.lessThanOrEqual("ftime", endtime));
filters.stream().forEach(System.out::println);
System.out.println(starttime);
System.out.println(endtime);
DataStream<RowData> batch = FlinkSource.forRowData()
.env(bsEnv)
.tableLoader(tableLoader)
.streaming(false)
.filters(filters)
.build();

----------------------------------------------------------------
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]