Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/18023#discussion_r124415882 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala --- @@ -244,6 +244,71 @@ class DatasetSuite extends QueryTest with SharedSQLContext { ("a", ClassData("a", 1)), ("b", ClassData("b", 2)), ("c", ClassData("c", 3))) } + test("REGEX column specification") { + val ds = Seq(("a", 1), ("b", 2), ("c", 3)).toDS() + + intercept[AnalysisException] { + ds.select(expr("`(_1)?+.+`").as[Int]) + } + + intercept[AnalysisException] { + ds.select(expr("`(_1|_2)`").as[Int]) + } + + intercept[AnalysisException] { + ds.select(ds("`(_1)?+.+`")) + } + + intercept[AnalysisException] { + ds.select(ds("`(_1|_2)`")) + } --- End diff -- Could you capture the exception error messages? It can help reviewers ensure the error messages are correct. For example ```Scala val e = intercept[AnalysisException] { ds.select(expr("`(_1)?+.+`").as[Int]) }.getMessage assert(e.contains("xyz")) ```
--- 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