-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test cases and update code style
- Loading branch information
bomeng
committed
Mar 27, 2016
1 parent
033b1ac
commit bdf44b4
Showing
2 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,10 +21,13 @@ import java.math.MathContext | |
import java.sql.Timestamp | ||
|
||
import org.apache.spark.AccumulatorSuite | ||
import org.apache.spark.sql.catalyst.FunctionIdentifier | ||
import org.apache.spark.sql.catalyst.analysis.UnresolvedException | ||
import org.apache.spark.sql.catalyst.catalog.CatalogFunction | ||
import org.apache.spark.sql.catalyst.expressions.SortOrder | ||
import org.apache.spark.sql.catalyst.plans.logical.Aggregate | ||
import org.apache.spark.sql.execution.aggregate | ||
import org.apache.spark.sql.execution.command.CreateFunction | ||
import org.apache.spark.sql.execution.joins.{BroadcastHashJoin, CartesianProduct, SortMergeJoin} | ||
import org.apache.spark.sql.functions._ | ||
import org.apache.spark.sql.internal.SQLConf | ||
|
@@ -2376,4 +2379,30 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext { | |
Row("r3c1x", "r3c2", "t1r3c3", "r3c2", "t1r3c3") :: Nil) | ||
} | ||
} | ||
|
||
test("SPARK-14123") { | ||
This comment has been minimized.
Sorry, something went wrong.
gatorsmile
Member
|
||
val sql1 = | ||
""" | ||
|CREATE TEMPORARY FUNCTION helloworld1 AS | ||
|'spark.example.SimpleUDFExample1' USING JAR '/path/to/jar1', | ||
|JAR '/path/to/jar2' | ||
""".stripMargin | ||
val sql2 = | ||
""" | ||
|CREATE FUNCTION helloworld2 AS | ||
|'spark.example.SimpleUDFExample2' USING ARCHIVE '/path/to/archive', | ||
|FILE '/path/to/file' | ||
""".stripMargin | ||
sql(sql1) | ||
sql(sql2) | ||
|
||
val catalog = sqlContext.sessionState.catalog | ||
val id1 = FunctionIdentifier("helloworld1", Some(catalog.getCurrentDatabase)) | ||
val id2 = FunctionIdentifier("helloworld2", Some(catalog.getCurrentDatabase)) | ||
|
||
val f1 = catalog.getFunction(id1) | ||
val f2 = catalog.getFunction(id2) | ||
assert(f1 == CatalogFunction(id1, "spark.example.SimpleUDFExample1")) | ||
assert(f2 == CatalogFunction(id2, "spark.example.SimpleUDFExample2")) | ||
} | ||
} |
Indents are still not right. You have to follow the indentation requirement, as shown in the following link:
https://cwiki.apache.org/confluence/display/SPARK/Spark+Code+Style+Guide