-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: message_as_jsonb
to handle circle dep in protobuf
#19935
Merged
Merged
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
4817b08
add
tabVersion 725a7c8
fix comments
tabVersion 598639d
Merge branch 'main' into tab/handle_circle_dep_proto
tabVersion bc44be4
format
e1fe3df
load from format_encode_options
2a6f68c
circular detect error message
11ed16f
fix
e13ad53
fix
1ae513a
test
e89de72
fix test
7bd3d3f
fix
35768e5
fix
cf83eb3
fix
666da5f
fix: enable control substitution
f165b1d
fix
4aa9d1b
handle stack overflow
b931440
remove pb
1e2ad3e
Merge remote-tracking branch 'origin' into tab/handle_circle_dep_proto
ebaba06
format
4735203
update testcase
e20d4fc
move proto to inline
2d14a7c
fix
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,42 @@ | ||
control substitution on | ||
|
||
system ok | ||
rpk registry schema create "opentelemetry_common.proto" --schema "/risingwave/src/connector/codec/tests/test_data/opentelemetry_common.proto" | ||
|
||
system ok | ||
rpk registry schema create "opentelemetry_test-value" --schema "/risingwave/src/connector/codec/tests/test_data/opentelemetry_test.proto" --references opentelemetry_common.proto:opentelemetry_common.proto:1 | ||
|
||
system ok | ||
echo '{"any_value":{"string_value":"example"},"key_value_list":{"values":[{"key":"key1","value":{"string_value":"value1"}},{"key":"key2","value":{"int_value":42}}]},"instrumentation_scope":{"name":"test-scope","version":"1.0"}}' | rpk topic produce "opentelemetry_test" --schema-id=topic --schema-type="opentelemetry_test.OTLPTestMessage" --allow-auto-topic-creation | ||
|
||
statement ok | ||
create table opentelemetry_test with ( ${RISEDEV_KAFKA_WITH_OPTIONS_COMMON}, topic = 'opentelemetry_test' ) format plain encode protobuf ( schema.registry = '${RISEDEV_SCHEMA_REGISTRY_URL}', message = 'opentelemetry_test.OTLPTestMessage', messages_as_jsonb = 'opentelemetry.proto.common.v1.ArrayValue,opentelemetry.proto.common.v1.KeyValueList,opentelemetry.proto.common.v1.AnyValue'); | ||
|
||
statement ok | ||
flush; | ||
|
||
sleep 1s | ||
|
||
query T | ||
select count(*) from opentelemetry_test; | ||
---- | ||
1 | ||
|
||
query TTT | ||
select any_value, key_value_list, instrumentation_scope from opentelemetry_test; | ||
---- | ||
{"stringValue": "example"} {"values": [{"key": "key1", "value": {"stringValue": "value1"}}, {"key": "key2", "value": {"intValue": "42"}}]} (test-scope,1.0,{},0) | ||
|
||
# ==== clean up ==== | ||
|
||
statement ok | ||
drop table opentelemetry_test; | ||
|
||
system ok | ||
rpk topic delete opentelemetry_test; | ||
|
||
system ok | ||
rpk registry subject delete "opentelemetry_test-value" | ||
|
||
system ok | ||
rpk registry subject delete "opentelemetry_common.proto" |
22 changes: 22 additions & 0 deletions
22
e2e_test/source_inline/kafka/protobuf/recursive_overflow.slt
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,22 @@ | ||
control substitution on | ||
|
||
system ok | ||
rpk registry schema create "recursive_complex-value" --schema "/risingwave/src/connector/codec/tests/test_data/recursive_complex.proto" | ||
|
||
system ok | ||
echo '{"array_value":{"value1":{"string_value":"This is a string value"},"value2":{"int_value":42},"array_value":{"value1":{"double_value":3.14159},"value2":{"bool_value":true},"array_value":{"value1":{"string_value":"Deeply nested string"},"value2":{"int_value":100}}}}}' | rpk topic produce "recursive_complex" --schema-id=topic --schema-type="recursive_complex.AnyValue" --allow-auto-topic-creation | ||
|
||
# the test just make sure the table can finish create process | ||
statement ok | ||
create table recursive_complex with ( ${RISEDEV_KAFKA_WITH_OPTIONS_COMMON}, topic = 'recursive_complex' ) format plain encode protobuf ( schema.registry = '${RISEDEV_SCHEMA_REGISTRY_URL}', message = 'recursive_complex.AnyValue', messages_as_jsonb = 'recursive_complex.AnyValue,recursive_complex.ArrayValue'); | ||
|
||
# ==== clean up ==== | ||
|
||
statement ok | ||
drop table recursive_complex; | ||
|
||
system ok | ||
rpk topic delete recursive_complex; | ||
|
||
system ok | ||
rpk registry subject delete "recursive_complex-value" |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentional bug fix