@@ -3264,12 +3264,15 @@ If None, a default is used.
3264
3264
Example setup using an AWS-hosted Iceberg with AWS Glue:
3265
3265
3266
3266
```
3267
- from quixstreams.sinks.community.iceberg import IcebergSink, IcebergAWSConfig
3267
+ from quixstreams import Application
3268
+ from quixstreams.sinks.community.iceberg import IcebergSink, AWSIcebergConfig
3268
3269
3269
- iceberg_config = IcebergAWSConfig(
3270
+ # Configure S3 bucket credentials
3271
+ iceberg_config = AWSIcebergConfig(
3270
3272
aws_s3_uri="", aws_region="", aws_access_key_id="", aws_secret_access_key=""
3271
3273
)
3272
3274
3275
+ # Configure the sink to write data to S3 with the AWS Glue catalog spec
3273
3276
iceberg_sink = IcebergSink(
3274
3277
table_name="glue.sink-test",
3275
3278
config=iceberg_config,
@@ -3278,10 +3281,16 @@ iceberg_sink = IcebergSink(
3278
3281
3279
3282
app = Application(broker_address='localhost:9092', auto_offset_reset="earliest")
3280
3283
topic = app.topic('sink_topic')
3284
+
3285
+ # Do some processing here
3281
3286
sdf = app.dataframe(topic=topic).print(metadata=True)
3287
+
3288
+ # Sink results to the IcebergSink
3282
3289
sdf.sink(iceberg_sink)
3283
3290
3291
+
3284
3292
if __name__ == "__main__":
3293
+ # Start the application
3285
3294
app.run()
3286
3295
```
3287
3296
@@ -3293,7 +3302,7 @@ if __name__ == "__main__":
3293
3302
def write(batch: SinkBatch)
3294
3303
```
3295
3304
3296
- [[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/sinks/community/iceberg.py#L165 )
3305
+ [[VIEW SOURCE]](https://github.com/quixio/quix-streams/blob/main/quixstreams/sinks/community/iceberg.py#L174 )
3297
3306
3298
3307
Writes a batch of data to the Iceberg table.
3299
3308
0 commit comments