Skip to content

Instantly share code, notes, and snippets.

@Samrose-Ahmed
Created September 22, 2022 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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