Open DanielMorales9 opened 1 day ago
Thanks for the feedback @DanielMorales9. Opened a PR to add support for this: #32688
P.S. Iceberg API works with Java time library, not Joda. After the PR is merged, you should be able to write timestamps if you change your schema to:
import org.apache.beam.sdk.schemas.logicaltypes.SqlTypes;
...
// Define Beam schema with a timestamp field
Schema beamSchema = Schema.builder()
.addStringField("id")
.addLogicalTypeField("event_timestamp", SqlTypes.DATETIME)
.build();
and your Row values to:
import java.time.LocalDateTime;
...
List<Row> hardcodedData = Arrays.asList(
Row.withSchema(beamSchema)
.addValues("record-1", LocalDateTime.now()) // Use Java-Time LocalDateTime
.build(),
....
@DanielMorales9 Scratch that -- we can add support for both Joda and Java libraries when writing to Iceberg (so your existing code should still work).
However, when reading from Iceberg, I'm afraid we will have to stick with just the Java time library (meaning the output Row field type will be SqlType.DATETIME)
Hi @ahmedabu98,
thank you for you quick reply 🙏
I left a few comments on the PR.
What happened?
When Trying to write timestamp data into an Iceberg Table I get the following exception:
Source code:
Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
Issue Components