gengliangwang commented on a change in pull request #35472:
URL: https://github.com/apache/spark/pull/35472#discussion_r803336147
##########
File path:
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerWithSparkContextSuite.scala
##########
@@ -61,22 +61,32 @@ trait ThriftServerWithSparkContextSuite extends
SharedThriftServer {
val sessionHandle = client.openSession(user, "")
val confOverlay = new java.util.HashMap[java.lang.String,
java.lang.String]
+ val exec: String => OperationHandle =
client.executeStatement(sessionHandle, _, confOverlay)
+
val e = intercept[HiveSQLException] {
- client.executeStatement(
- sessionHandle,
- sql,
- confOverlay)
+ exec(s"set ${SQLConf.ANSI_ENABLED.key}=false")
+ exec(sql)
}
assert(e.getMessage
.contains("The second argument of 'date_sub' function needs to be an
integer."))
assert(!e.getMessage.contains("" +
"java.lang.NumberFormatException: invalid input syntax for type
numeric: 1.2"))
assert(e.getSQLState == "22023")
+
+ val e1 = intercept[HiveSQLException] {
+ exec(s"set ${SQLConf.ANSI_ENABLED.key}=true")
+ exec(sql)
+ }
+
+ assert(e.getMessage
Review comment:
Shall we check e1 instead?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]