diff options
Diffstat (limited to 'sql/catalyst/src/test')
-rw-r--r-- | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala index dbc5db39ae..4e399eef1f 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala @@ -331,16 +331,17 @@ class ExpressionParserSuite extends PlanTest { test("type constructors") { // Dates. assertEqual("dAte '2016-03-11'", Literal(Date.valueOf("2016-03-11"))) - intercept[IllegalArgumentException] { - parseExpression("DAtE 'mar 11 2016'") - } + intercept("DAtE 'mar 11 2016'") // Timestamps. assertEqual("tImEstAmp '2016-03-11 20:54:00.000'", Literal(Timestamp.valueOf("2016-03-11 20:54:00.000"))) - intercept[IllegalArgumentException] { - parseExpression("timestamP '2016-33-11 20:54:00.000'") - } + intercept("timestamP '2016-33-11 20:54:00.000'") + + // Binary. + assertEqual("X'A'", Literal(Array(0x0a).map(_.toByte))) + assertEqual("x'A10C'", Literal(Array(0xa1, 0x0c).map(_.toByte))) + intercept("x'A1OC'") // Unsupported datatype. intercept("GEO '(10,-6)'", "Literals of type 'GEO' are currently not supported.") |