-
Notifications
You must be signed in to change notification settings - Fork 613
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: connection for schema registry (#19685)
Co-authored-by: tabversion <[email protected]>
- Loading branch information
1 parent
5ba9a73
commit 45d2664
Showing
7 changed files
with
124 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
control substitution on | ||
|
||
statement ok | ||
SET streaming_use_shared_source TO false; | ||
|
||
statement error unknown field `aws.region`, expected one of `schema.registry`, `schema.registry.username`, `schema.registry.password` | ||
CREATE CONNECTION schema_registry_conn with ( type = 'schema_registry', aws.region = 'us-east-1'); | ||
|
||
statement ok | ||
CREATE CONNECTION schema_registry_conn with ( type = 'schema_registry', schema.registry = '${RISEDEV_SCHEMA_REGISTRY_URL}'); | ||
|
||
# cleanup | ||
system ok | ||
rpk topic delete 'sr_conn_test' || true; \ | ||
(rpk sr subject delete 'sr_conn_test-value' && rpk sr subject delete 'sr_conn_test-value' --permanent) || true; | ||
|
||
# create topic and sr subject | ||
system ok | ||
rpk topic create 'sr_conn_test' | ||
|
||
system ok | ||
sr_register sr_conn_test-value AVRO <<< '{"type":"record","name":"Root","fields":[{"name":"bar","type":"int","default":0},{"name":"foo","type":"string"}]}' | ||
|
||
system ok | ||
echo '{"foo":"ABC", "bar":1}' | rpk topic produce --schema-id=topic sr_conn_test | ||
|
||
statement error Invalid Parameter Value: Glue related options/secrets are not allowed when using schema registry connection | ||
create table t | ||
WITH ( | ||
${RISEDEV_KAFKA_WITH_OPTIONS_COMMON}, | ||
topic = 'sr_conn_test' | ||
) | ||
FORMAT PLAIN ENCODE AVRO ( | ||
connection = schema_registry_conn, | ||
aws.region = 'us-east-1' | ||
); | ||
|
||
statement ok | ||
create table t | ||
WITH ( | ||
${RISEDEV_KAFKA_WITH_OPTIONS_COMMON}, | ||
topic = 'sr_conn_test' | ||
) | ||
FORMAT PLAIN ENCODE AVRO ( | ||
connection = schema_registry_conn | ||
); | ||
|
||
# clean up | ||
|
||
statement ok | ||
drop table t; | ||
|
||
statement ok | ||
drop connection schema_registry_conn; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters