aboutsummaryrefslogtreecommitdiff
path: root/sql/hive/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'sql/hive/src/main')
-rw-r--r--sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
index 1f688fe111..93b9057a23 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
@@ -233,6 +233,11 @@ private[hive] object HiveQl {
}
} catch {
case e: Exception => throw new ParseException(sql, e)
+ case e: NotImplementedError => sys.error(
+ s"""
+ |Unsupported language features in query: $sql
+ |${dumpTree(getAst(sql))}
+ """.stripMargin)
}
}
@@ -865,6 +870,17 @@ private[hive] object HiveQl {
IsNull(nodeToExpr(child))
case Token("TOK_FUNCTION", Token("IN", Nil) :: value :: list) =>
In(nodeToExpr(value), list.map(nodeToExpr))
+ case Token("TOK_FUNCTION",
+ Token("between", Nil) ::
+ Token("KW_FALSE", Nil) ::
+ target ::
+ minValue ::
+ maxValue :: Nil) =>
+
+ val targetExpression = nodeToExpr(target)
+ And(
+ GreaterThanOrEqual(targetExpression, nodeToExpr(minValue)),
+ LessThanOrEqual(targetExpression, nodeToExpr(maxValue)))
/* Boolean Logic */
case Token(AND(), left :: right:: Nil) => And(nodeToExpr(left), nodeToExpr(right))