Github user jayadevanmurali commented on a diff in the pull request: https://github.com/apache/spark/pull/11051#discussion_r51762232 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala --- @@ -1291,4 +1291,14 @@ class DataFrameSuite extends QueryTest with SharedSQLContext { Seq(1 -> "a").toDF("i", "j").filter($"i".cast(StringType) === "1"), Row(1, "a")) } + + test("SPARK-12982: Add table name validation in temp table registration") { + val rows = List(Row("foo"), Row("bar")) + val schema = StructType(Seq(StructField("col", StringType))) + val rdd = sparkContext.parallelize(rows) + val df = sqlContext.createDataFrame(rdd, schema) + assert(intercept[AnalysisException](df.registerTempTable("t~")) + .getMessage.contains("NoViableAltException")) --- End diff -- @hvanhovell So we can simply intercept analysis exception instead of asserting NoViableAltException. Am I right ?
--- 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