Skip to content
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

test: add test for FK-join with format mismatch #7588

Merged
merged 1 commit into from
May 26, 2021
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,60 @@
],
"post": {
"topics": {
"topics": [
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just updating the post condition for this test in addition.

{
"name": "OUTPUT",
"keyFormat": { "format": "KAFKA" },
"valueFormat": { "format": "JSON" },
"partitions": 4
}
],
"blacklist": ".*-repartition"
}
}
},
{
"enabled": false,
"name": "Should allow format mismatch without repartitioning",
"properties": {
"ksql.joins.foreign.key.enable": true
},
"statements": [
"CREATE TABLE left_table (l_id BIGINT PRIMARY KEY, name VARCHAR, foreign_key BIGINT) WITH (kafka_topic='left_topic', format='AVRO');",
"CREATE TABLE right_table (r_id BIGINT PRIMARY KEY, f1 VARCHAR, f2 BIGINT) WITH (kafka_topic='right_topic', format='JSON');",
"CREATE TABLE output AS SELECT l_id, r_id, name, f1 FROM left_table JOIN right_table ON foreign_key = r_id;"
],
"inputs": [
{"topic": "right_topic", "key": 0, "value": {"F1": "blah", "F2": 4}, "timestamp": 0},
{"topic": "left_topic", "key": 1, "value": {"NAME": "zero", "FOREIGN_KEY": 0}, "timestamp": 10000},
{"topic": "left_topic", "key": 0, "value": {"NAME": "foo", "FOREIGN_KEY": 100}, "timestamp": 13000},
{"topic": "right_topic", "key": 0, "value": {"F1": "a", "F2": 10}, "timestamp": 15000},
{"topic": "left_topic", "key": 10, "value": {"NAME": "bar", "FOREIGN_KEY": 0}, "timestamp": 16000},
{"topic": "right_topic", "key": 0, "value": null, "timestamp": 17000},
{"topic": "left_topic", "key": 1, "value": null, "timestamp": 18000}
],
"outputs": [
{"topic": "OUTPUT", "key": 1, "value": {"R_ID": 0, "NAME": "zero", "F1": "blah"}, "timestamp": 10000},
{"topic": "OUTPUT", "key": 1, "value": {"R_ID": 0, "NAME": "zero", "F1": "a"}, "timestamp": 15000},
{"topic": "OUTPUT", "key": 10, "value": {"R_ID": 0, "NAME": "bar", "F1": "a"}, "timestamp": 16000},
{"topic": "OUTPUT", "key": 1, "value": null, "timestamp": 17000},
{"topic": "OUTPUT", "key": 10, "value": null, "timestamp": 17000},
{"topic": "OUTPUT", "key": 1, "value": null, "timestamp": 18000}
],
"post": {
"topics": {
"topics": [
{
"name": "OUTPUT",
"keyFormat": {
"format": "AVRO",
"properties": { "fullSchemaName": "io.confluent.ksql.avro_schemas.OutputKey" },
"features": ["UNWRAP_SINGLES"]
},
"valueFormat": { "format": "AVRO" },
"partitions": 4
}
],
"blacklist": ".*-repartition"
}
}
Expand Down