Skip to content

Commit

Permalink
example
Browse files Browse the repository at this point in the history
  • Loading branch information
gatorsmile committed Apr 3, 2017
1 parent 567a50a commit d9c24b3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ object ResolveTableValuedFunctions extends Rule[LogicalPlan] {

override def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators {
case u: UnresolvedTableValuedFunction if u.functionArgs.forall(_.resolved) =>
builtinFunctions.get(u.functionName) match {
builtinFunctions.get(u.functionName.toLowerCase) match {
case Some(tvf) =>
val resolved = tvf.flatMap { case (argList, resolver) =>
argList.implicitCast(u.functionArgs) match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ select * from range(1, 1, 1, 1, 1);

-- range call with null
select * from range(1, null);

-- range call with a mixed-case function name
select * from RaNgE(2);

-- Explain
EXPLAIN select * from RaNgE(2);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 7
-- Number of queries: 9


-- !query 0
Expand Down Expand Up @@ -85,3 +85,21 @@ struct<>
-- !query 6 output
java.lang.IllegalArgumentException
Invalid arguments for resolved function: 1, null


-- !query 7
select * from RaNgE(2)
-- !query 7 schema
struct<id:bigint>
-- !query 7 output
0
1


-- !query 8
EXPLAIN select * from RaNgE(2)
-- !query 8 schema
struct<plan:string>
-- !query 8 output
== Physical Plan ==
*Range (0, 2, step=1, splits=None)

0 comments on commit d9c24b3

Please sign in to comment.