-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support quoted identifiers in column names (#3477)
- Loading branch information
Showing
19 changed files
with
347 additions
and
150 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
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
39 changes: 0 additions & 39 deletions
39
ksql-functional-tests/src/main/java/io/confluent/ksql/test/utils/TestParsingUtil.java
This file was deleted.
Oops, something went wrong.
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
94 changes: 94 additions & 0 deletions
94
ksql-functional-tests/src/test/resources/query-validation-tests/quoted-identifiers.json
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,94 @@ | ||
{ | ||
"comments": [ | ||
"Tests covering the use of quoted identifiers." | ||
], | ||
"tests": [ | ||
{ | ||
"name": "source fields that require quotes", | ||
"statements": [ | ||
"CREATE STREAM TEST (`with.dot` VARCHAR, `*bad!chars*` VARCHAR, `SELECT` VARCHAR) WITH (kafka_topic='test_topic', value_format='JSON');", | ||
"CREATE STREAM OUTPUT AS SELECT * FROM TEST;" | ||
], | ||
"inputs": [ | ||
{"topic": "test_topic", "value": {"with.dot": "popcorn", "*bad!chars*": "cheetos", "SELECT": "reserved"}} | ||
], | ||
"outputs": [ | ||
{"topic": "OUTPUT", "value": {"with.dot": "popcorn", "*bad!chars*": "cheetos", "SELECT": "reserved"}} | ||
] | ||
}, | ||
{ | ||
"name": "sink fields that require quotes", | ||
"statements": [ | ||
"CREATE STREAM TEST (a VARCHAR, b VARCHAR, c VARCHAR) WITH (kafka_topic='test_topic', value_format='JSON');", | ||
"CREATE STREAM OUTPUT AS SELECT A as `with.dot`, B as `*bad!chars*`, C as `SELECT` FROM TEST;" | ||
], | ||
"inputs": [ | ||
{"topic": "test_topic", "value": {"A": "popcorn", "B": "cheetos", "C": "reserved"}} | ||
], | ||
"outputs": [ | ||
{"topic": "OUTPUT", "value": {"with.dot": "popcorn", "*bad!chars*": "cheetos", "SELECT": "reserved"}} | ||
] | ||
}, | ||
{ | ||
"name": "udf using fields that require quotes", | ||
"statements": [ | ||
"CREATE STREAM TEST (`SELECT` INT) WITH (kafka_topic='test_topic', value_format='JSON');", | ||
"CREATE STREAM OUTPUT AS SELECT ABS(`SELECT`) FOO FROM TEST;" | ||
], | ||
"inputs": [ | ||
{"topic": "test_topic", "value": {"SELECT": -2}} | ||
], | ||
"outputs": [ | ||
{"topic": "OUTPUT", "value": { "FOO": 2.0}} | ||
] | ||
}, | ||
{ | ||
"name": "math using fields that require quotes", | ||
"statements": [ | ||
"CREATE STREAM TEST (`SELECT` INT, `with.dot` INT) WITH (kafka_topic='test_topic', value_format='JSON');", | ||
"CREATE STREAM OUTPUT AS SELECT `SELECT` * `with.dot` AS FOO FROM TEST;" | ||
], | ||
"inputs": [ | ||
{"topic": "test_topic", "value": {"with.dot": 1, "SELECT": 2}} | ||
], | ||
"outputs": [ | ||
{"topic": "OUTPUT", "value": { "FOO": 2}} | ||
] | ||
}, | ||
{ | ||
"name": "create table with key that is quoted", | ||
"statements": [ | ||
"CREATE TABLE TEST (`some.key` VARCHAR) WITH (kafka_topic='test_topic', key='`some.key`', value_format='JSON');", | ||
"CREATE TABLE OUTPUT AS SELECT * FROM TEST;" | ||
], | ||
"inputs": [ | ||
{"topic": "test_topic", "value": {"some.key": "key"}} | ||
], | ||
"outputs": [ | ||
{"topic": "OUTPUT", "value": {"some.key": "key"}} | ||
], | ||
"post": { | ||
"sources": [ | ||
{"name": "TEST", "type": "table", "keyField": {"name": "`some.key`", "legacyName": "`some.key`"}}, | ||
{"name": "OUTPUT", "type": "table", "keyField": {"name": "`some.key`", "legacyName": "`some.key`"}} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "joins using fields that require quotes", | ||
"statements": [ | ||
"CREATE STREAM L (`SELECT` VARCHAR, `field!` VARCHAR) WITH (kafka_topic='left_topic', value_format='JSON');", | ||
"CREATE TABLE R (`with.dot` VARCHAR) WITH (kafka_topic='right_topic', value_format='JSON', key='`with.dot`');", | ||
"CREATE STREAM JOINED as SELECT L.`field!` FROM L LEFT JOIN R ON L.`SELECT` = R.`with.dot`;" | ||
], | ||
"inputs": [ | ||
{"topic": "left_topic", "value": {"SELECT": "1", "field!": "A"}}, | ||
{"topic": "right_topic", "value": {"with.dot": "1"}}, | ||
{"topic": "right_topic", "value": {"with.dot": "2"}} | ||
], | ||
"outputs": [ | ||
{"topic": "JOINED", "key": "1", "value": { "field!": "A"}} | ||
] | ||
} | ||
] | ||
} |
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.