Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/18023#discussion_r117586530 --- Diff: sql/core/src/test/resources/sql-tests/inputs/query_regex_column.sql --- @@ -0,0 +1,24 @@ +CREATE OR REPLACE TEMPORARY VIEW testData AS SELECT * FROM VALUES +(1, "1"), (2, "2"), (3, "3"), (4, "4"), (5, "5"), (6, "6") +AS testData(key, value); + +CREATE OR REPLACE TEMPORARY VIEW testData2 AS SELECT * FROM VALUES +(1, 1), (1, 2), (2, 1), (2, 2), (3, 1), (3, 2) +AS testData2(a, b); + +-- AnalysisException +SELECT `(a)?+.+` FROM testData2 WHERE a = 1; + +-- AnalysisException +SELECT t.`(a)?+.+` FROM testData2 t WHERE a = 1; + +set spark.sql.parser.quotedRegexColumnNames=true; + +-- Regex columns +SELECT `(a)?+.+` FROM testData2 WHERE a = 1; +SELECT t.`(a)?+.+` FROM testData2 t WHERE a = 1; +SELECT p.`(key)?+.+`, b, testdata2.`(b)?+.+` FROM testData p join testData2 ON p.key = testData2.a WHERE key < 3; + +-- Clean-up +DROP VIEW IF EXISTS testData; +DROP VIEW IF EXISTS testData2; --- End diff -- No need to drop the temp views.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org