Skip to content

Instantly share code, notes, and snippets.

@Samrose-Ahmed
Created September 22, 2022 17:53
Show Gist options
  • Save Samrose-Ahmed/adfca407de1c4f389fbac9d3b0320895 to your computer and use it in GitHub Desktop.
Save Samrose-Ahmed/adfca407de1c4f389fbac9d3b0320895 to your computer and use it in GitHub Desktop.
class IcebergMetadataWriter {
// In a real world usecase, you can create this dynamically from the data.
val icebergTable: Table = icebergCatalog.loadTable(TableIdentifier.of(Namespace.of(NAMESPACE), TABLE_NAME))
val appendFiles: AppendFiles = icebergTable.newAppend()
// Lambda handler
fun handle(sqsEvent: SQSEvent) {
for (record in sqsEvent.records) {
processRecord(record, tableObjs)
}
appendFiles.commit()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment