Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion yaml/README_Kafka_To_Bigtable_Yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ on [Metadata Annotations](https://github.com/GoogleCloudPlatform/DataflowTemplat

### Optional parameters

* **autoOffsetResetConfig**: What to do when there is no initial offset in Kafka or if the current offset does not exist any more on the server. (1) earliest: automatically reset the offset to the earliest offset. (2) latest: automatically reset the offset to the latest offset (3) none: throw exception to the consumer if no previous offset is found for the consumer's group. For example: earliest For example, `earliest`. Defaults to: earliest.
* **confluentSchemaRegistrySubject**: The subject name for the Confluent Schema Registry. For example: my_subject For example, `my_subject`.
* **confluentSchemaRegistryUrl**: The URL for the Confluent Schema Registry. For example: http://schema-registry:8081 For example, `http://schema-registry:8081`.
* **consumerConfigUpdates**: A list of key-value pairs that act as configuration parameters for Kafka consumers. For example: {'group.id': 'my_group'} For example, `{"group.id": "my_group"}`.
* **fileDescriptorPath**: The path to the Protocol Buffer File Descriptor Set file. For example: gs://bucket/path/to/descriptor.pb For example, `gs://bucket/path/to/descriptor.pb`.
* **format**: The encoding format for the data stored in Kafka. Valid options are: RAW,STRING,AVRO,JSON,PROTO. For example: JSON For example, `JSON`. Defaults to: JSON.
* **maxReadTimeSeconds**: Upper bound of how long to read from Kafka in seconds. For example: 60 For example, `60`.
* **messageName**: The name of the Protocol Buffer message to be used for schema extraction and data conversion. For example: MyMessage For example, `MyMessage`.
* **schema**: The schema in which the data is encoded in the Kafka topic. For example: {'type': 'record', 'name': 'User', 'fields': [{'name': 'name', 'type': 'string'}]}. A schema is required if data format is JSON, AVRO or PROTO. For example, `{"type": "record", "name": "User", "fields": [{"name": "name", "type": "string"}]}`.
* **language**: The language used to define (and execute) the expressions and/or callables in fields. Defaults to generic. For example, `python`.
Expand Down Expand Up @@ -137,11 +139,13 @@ export TABLE_ID=<tableId>
export WINDOWING=<windowing>

### Optional
export AUTO_OFFSET_RESET_CONFIG=earliest
export CONFLUENT_SCHEMA_REGISTRY_SUBJECT=<confluentSchemaRegistrySubject>
export CONFLUENT_SCHEMA_REGISTRY_URL=<confluentSchemaRegistryUrl>
export CONSUMER_CONFIG_UPDATES=<consumerConfigUpdates>
export FILE_DESCRIPTOR_PATH=<fileDescriptorPath>
export FORMAT=JSON
export MAX_READ_TIME_SECONDS=<maxReadTimeSeconds>
export MESSAGE_NAME=<messageName>
export SCHEMA=<schema>
export LANGUAGE=generic
Expand All @@ -152,11 +156,13 @@ gcloud dataflow flex-template run "kafka-to-bigtable-yaml-job" \
--template-file-gcs-location "$TEMPLATE_SPEC_GCSPATH" \
--parameters "bootstrapServers=$BOOTSTRAP_SERVERS" \
--parameters "topic=$TOPIC" \
--parameters "autoOffsetResetConfig=$AUTO_OFFSET_RESET_CONFIG" \
--parameters "confluentSchemaRegistrySubject=$CONFLUENT_SCHEMA_REGISTRY_SUBJECT" \
--parameters "confluentSchemaRegistryUrl=$CONFLUENT_SCHEMA_REGISTRY_URL" \
--parameters "consumerConfigUpdates=$CONSUMER_CONFIG_UPDATES" \
--parameters "fileDescriptorPath=$FILE_DESCRIPTOR_PATH" \
--parameters "format=$FORMAT" \
--parameters "maxReadTimeSeconds=$MAX_READ_TIME_SECONDS" \
--parameters "messageName=$MESSAGE_NAME" \
--parameters "schema=$SCHEMA" \
--parameters "language=$LANGUAGE" \
Expand Down Expand Up @@ -192,11 +198,13 @@ export TABLE_ID=<tableId>
export WINDOWING=<windowing>

### Optional
export AUTO_OFFSET_RESET_CONFIG=earliest
export CONFLUENT_SCHEMA_REGISTRY_SUBJECT=<confluentSchemaRegistrySubject>
export CONFLUENT_SCHEMA_REGISTRY_URL=<confluentSchemaRegistryUrl>
export CONSUMER_CONFIG_UPDATES=<consumerConfigUpdates>
export FILE_DESCRIPTOR_PATH=<fileDescriptorPath>
export FORMAT=JSON
export MAX_READ_TIME_SECONDS=<maxReadTimeSeconds>
export MESSAGE_NAME=<messageName>
export SCHEMA=<schema>
export LANGUAGE=generic
Expand All @@ -208,7 +216,7 @@ mvn clean package -PtemplatesRun \
-Dregion="$REGION" \
-DjobName="kafka-to-bigtable-yaml-job" \
-DtemplateName="Kafka_To_Bigtable_Yaml" \
-Dparameters="bootstrapServers=$BOOTSTRAP_SERVERS,topic=$TOPIC,confluentSchemaRegistrySubject=$CONFLUENT_SCHEMA_REGISTRY_SUBJECT,confluentSchemaRegistryUrl=$CONFLUENT_SCHEMA_REGISTRY_URL,consumerConfigUpdates=$CONSUMER_CONFIG_UPDATES,fileDescriptorPath=$FILE_DESCRIPTOR_PATH,format=$FORMAT,messageName=$MESSAGE_NAME,schema=$SCHEMA,language=$LANGUAGE,fields=$FIELDS,projectId=$PROJECT_ID,instanceId=$INSTANCE_ID,tableId=$TABLE_ID,windowing=$WINDOWING" \
-Dparameters="bootstrapServers=$BOOTSTRAP_SERVERS,topic=$TOPIC,autoOffsetResetConfig=$AUTO_OFFSET_RESET_CONFIG,confluentSchemaRegistrySubject=$CONFLUENT_SCHEMA_REGISTRY_SUBJECT,confluentSchemaRegistryUrl=$CONFLUENT_SCHEMA_REGISTRY_URL,consumerConfigUpdates=$CONSUMER_CONFIG_UPDATES,fileDescriptorPath=$FILE_DESCRIPTOR_PATH,format=$FORMAT,maxReadTimeSeconds=$MAX_READ_TIME_SECONDS,messageName=$MESSAGE_NAME,schema=$SCHEMA,language=$LANGUAGE,fields=$FIELDS,projectId=$PROJECT_ID,instanceId=$INSTANCE_ID,tableId=$TABLE_ID,windowing=$WINDOWING" \
-f yaml
```

Expand Down Expand Up @@ -260,11 +268,13 @@ resource "google_dataflow_flex_template_job" "kafka_to_bigtable_yaml" {
instanceId = "<instanceId>"
tableId = "<tableId>"
windowing = "<windowing>"
# autoOffsetResetConfig = "earliest"
# confluentSchemaRegistrySubject = "<confluentSchemaRegistrySubject>"
# confluentSchemaRegistryUrl = "<confluentSchemaRegistryUrl>"
# consumerConfigUpdates = "<consumerConfigUpdates>"
# fileDescriptorPath = "<fileDescriptorPath>"
# format = "JSON"
# maxReadTimeSeconds = "<maxReadTimeSeconds>"
# messageName = "<messageName>"
# schema = "<schema>"
# language = "generic"
Expand Down
12 changes: 11 additions & 1 deletion yaml/README_Kafka_To_Iceberg_Yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ on [Metadata Annotations](https://github.com/GoogleCloudPlatform/DataflowTemplat

### Optional parameters

* **autoOffsetResetConfig**: What to do when there is no initial offset in Kafka or if the current offset does not exist any more on the server. (1) earliest: automatically reset the offset to the earliest offset. (2) latest: automatically reset the offset to the latest offset (3) none: throw exception to the consumer if no previous offset is found for the consumer's group. For example: earliest For example, `earliest`. Defaults to: earliest.
* **confluentSchemaRegistrySubject**: The subject name for the Confluent Schema Registry. For example: my_subject For example, `my_subject`.
* **confluentSchemaRegistryUrl**: The URL for the Confluent Schema Registry. For example: http://schema-registry:8081 For example, `http://schema-registry:8081`.
* **consumerConfigUpdates**: A list of key-value pairs that act as configuration parameters for Kafka consumers. For example: {'group.id': 'my_group'} For example, `{"group.id": "my_group"}`.
* **fileDescriptorPath**: The path to the Protocol Buffer File Descriptor Set file. For example: gs://bucket/path/to/descriptor.pb For example, `gs://bucket/path/to/descriptor.pb`.
* **format**: The encoding format for the data stored in Kafka. Valid options are: RAW,STRING,AVRO,JSON,PROTO. For example: JSON For example, `JSON`. Defaults to: JSON.
* **maxReadTimeSeconds**: Upper bound of how long to read from Kafka in seconds. For example: 60 For example, `60`.
* **messageName**: The name of the Protocol Buffer message to be used for schema extraction and data conversion. For example: MyMessage For example, `MyMessage`.
* **schema**: The schema in which the data is encoded in the Kafka topic. For example: {'type': 'record', 'name': 'User', 'fields': [{'name': 'name', 'type': 'string'}]}. A schema is required if data format is JSON, AVRO or PROTO. For example, `{"type": "record", "name": "User", "fields": [{"name": "name", "type": "string"}]}`.
* **configProperties**: A map of properties to pass to the Hadoop Configuration. For example, `{"fs.gs.impl": "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem"}`.
Expand Down Expand Up @@ -138,11 +140,13 @@ export CATALOG_PROPERTIES=<catalogProperties>
export TRIGGERING_FREQUENCY_SECONDS=<triggeringFrequencySeconds>

### Optional
export AUTO_OFFSET_RESET_CONFIG=earliest
export CONFLUENT_SCHEMA_REGISTRY_SUBJECT=<confluentSchemaRegistrySubject>
export CONFLUENT_SCHEMA_REGISTRY_URL=<confluentSchemaRegistryUrl>
export CONSUMER_CONFIG_UPDATES=<consumerConfigUpdates>
export FILE_DESCRIPTOR_PATH=<fileDescriptorPath>
export FORMAT=JSON
export MAX_READ_TIME_SECONDS=<maxReadTimeSeconds>
export MESSAGE_NAME=<messageName>
export SCHEMA=<schema>
export CONFIG_PROPERTIES=<configProperties>
Expand All @@ -160,11 +164,13 @@ gcloud dataflow flex-template run "kafka-to-iceberg-yaml-job" \
--template-file-gcs-location "$TEMPLATE_SPEC_GCSPATH" \
--parameters "bootstrapServers=$BOOTSTRAP_SERVERS" \
--parameters "topic=$TOPIC" \
--parameters "autoOffsetResetConfig=$AUTO_OFFSET_RESET_CONFIG" \
--parameters "confluentSchemaRegistrySubject=$CONFLUENT_SCHEMA_REGISTRY_SUBJECT" \
--parameters "confluentSchemaRegistryUrl=$CONFLUENT_SCHEMA_REGISTRY_URL" \
--parameters "consumerConfigUpdates=$CONSUMER_CONFIG_UPDATES" \
--parameters "fileDescriptorPath=$FILE_DESCRIPTOR_PATH" \
--parameters "format=$FORMAT" \
--parameters "maxReadTimeSeconds=$MAX_READ_TIME_SECONDS" \
--parameters "messageName=$MESSAGE_NAME" \
--parameters "schema=$SCHEMA" \
--parameters "table=$TABLE" \
Expand Down Expand Up @@ -205,11 +211,13 @@ export CATALOG_PROPERTIES=<catalogProperties>
export TRIGGERING_FREQUENCY_SECONDS=<triggeringFrequencySeconds>

### Optional
export AUTO_OFFSET_RESET_CONFIG=earliest
export CONFLUENT_SCHEMA_REGISTRY_SUBJECT=<confluentSchemaRegistrySubject>
export CONFLUENT_SCHEMA_REGISTRY_URL=<confluentSchemaRegistryUrl>
export CONSUMER_CONFIG_UPDATES=<consumerConfigUpdates>
export FILE_DESCRIPTOR_PATH=<fileDescriptorPath>
export FORMAT=JSON
export MAX_READ_TIME_SECONDS=<maxReadTimeSeconds>
export MESSAGE_NAME=<messageName>
export SCHEMA=<schema>
export CONFIG_PROPERTIES=<configProperties>
Expand All @@ -228,7 +236,7 @@ mvn clean package -PtemplatesRun \
-Dregion="$REGION" \
-DjobName="kafka-to-iceberg-yaml-job" \
-DtemplateName="Kafka_To_Iceberg_Yaml" \
-Dparameters="bootstrapServers=$BOOTSTRAP_SERVERS,topic=$TOPIC,confluentSchemaRegistrySubject=$CONFLUENT_SCHEMA_REGISTRY_SUBJECT,confluentSchemaRegistryUrl=$CONFLUENT_SCHEMA_REGISTRY_URL,consumerConfigUpdates=$CONSUMER_CONFIG_UPDATES,fileDescriptorPath=$FILE_DESCRIPTOR_PATH,format=$FORMAT,messageName=$MESSAGE_NAME,schema=$SCHEMA,table=$TABLE,catalogName=$CATALOG_NAME,catalogProperties=$CATALOG_PROPERTIES,configProperties=$CONFIG_PROPERTIES,drop=$DROP,keep=$KEEP,only=$ONLY,partitionFields=$PARTITION_FIELDS,tableProperties=$TABLE_PROPERTIES,triggeringFrequencySeconds=$TRIGGERING_FREQUENCY_SECONDS,sdfCheckpointAfterDuration=$SDF_CHECKPOINT_AFTER_DURATION,sdfCheckpointAfterOutputBytes=$SDF_CHECKPOINT_AFTER_OUTPUT_BYTES" \
-Dparameters="bootstrapServers=$BOOTSTRAP_SERVERS,topic=$TOPIC,autoOffsetResetConfig=$AUTO_OFFSET_RESET_CONFIG,confluentSchemaRegistrySubject=$CONFLUENT_SCHEMA_REGISTRY_SUBJECT,confluentSchemaRegistryUrl=$CONFLUENT_SCHEMA_REGISTRY_URL,consumerConfigUpdates=$CONSUMER_CONFIG_UPDATES,fileDescriptorPath=$FILE_DESCRIPTOR_PATH,format=$FORMAT,maxReadTimeSeconds=$MAX_READ_TIME_SECONDS,messageName=$MESSAGE_NAME,schema=$SCHEMA,table=$TABLE,catalogName=$CATALOG_NAME,catalogProperties=$CATALOG_PROPERTIES,configProperties=$CONFIG_PROPERTIES,drop=$DROP,keep=$KEEP,only=$ONLY,partitionFields=$PARTITION_FIELDS,tableProperties=$TABLE_PROPERTIES,triggeringFrequencySeconds=$TRIGGERING_FREQUENCY_SECONDS,sdfCheckpointAfterDuration=$SDF_CHECKPOINT_AFTER_DURATION,sdfCheckpointAfterOutputBytes=$SDF_CHECKPOINT_AFTER_OUTPUT_BYTES" \
-f yaml
```

Expand Down Expand Up @@ -279,11 +287,13 @@ resource "google_dataflow_flex_template_job" "kafka_to_iceberg_yaml" {
catalogName = "<catalogName>"
catalogProperties = "<catalogProperties>"
triggeringFrequencySeconds = "<triggeringFrequencySeconds>"
# autoOffsetResetConfig = "earliest"
# confluentSchemaRegistrySubject = "<confluentSchemaRegistrySubject>"
# confluentSchemaRegistryUrl = "<confluentSchemaRegistryUrl>"
# consumerConfigUpdates = "<consumerConfigUpdates>"
# fileDescriptorPath = "<fileDescriptorPath>"
# format = "JSON"
# maxReadTimeSeconds = "<maxReadTimeSeconds>"
# messageName = "<messageName>"
# schema = "<schema>"
# configProperties = "<configProperties>"
Expand Down
Loading
Loading