Repository: spark
Updated Branches:
  refs/heads/branch-2.1 c46928ff9 -> a0c1c699e


[SPARK-16282][SQL] Follow-up: remove "percentile" from temp function detection 
after implementing it natively

## What changes were proposed in this pull request?

In #15764 we added a mechanism to detect if a function is temporary or not. 
Hive functions are treated as non-temporary. Of the three hive functions, now 
"percentile" has been implemented natively, and "hash" has been removed. So we 
should update the list.

## How was this patch tested?

Unit tests.

Author: Shuai Lin <[email protected]>

Closes #16049 from lins05/update-temp-function-detect-hive-list.

(cherry picked from commit e64a2047eaf02d65dcf98b6e0710e10196aa74b1)
Signed-off-by: gatorsmile <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/a0c1c699
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/a0c1c699
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/a0c1c699

Branch: refs/heads/branch-2.1
Commit: a0c1c699e3c09027f6daa728a9ea2a8c0cd12d1c
Parents: c46928f
Author: Shuai Lin <[email protected]>
Authored: Mon Nov 28 20:23:48 2016 -0800
Committer: gatorsmile <[email protected]>
Committed: Mon Nov 28 20:26:15 2016 -0800

----------------------------------------------------------------------
 .../org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala  | 5 +----
 .../apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala | 1 -
 2 files changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/a0c1c699/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
----------------------------------------------------------------------
diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
index 002aecb..0b6a91f 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
@@ -939,10 +939,7 @@ class SessionCatalog(
    */
   def isTemporaryFunction(name: FunctionIdentifier): Boolean = {
     // copied from HiveSessionCatalog
-    val hiveFunctions = Seq(
-      "hash",
-      "histogram_numeric",
-      "percentile")
+    val hiveFunctions = Seq("histogram_numeric")
 
     // A temporary function is a function that has been registered in 
functionRegistry
     // without a database name, and is neither a built-in function nor a Hive 
function

http://git-wip-us.apache.org/repos/asf/spark/blob/a0c1c699/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala
----------------------------------------------------------------------
diff --git 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala
 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala
index da41d36..3f27160 100644
--- 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala
+++ 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala
@@ -981,7 +981,6 @@ class SessionCatalogSuite extends SparkFunSuite {
     assert(FunctionRegistry.builtin.functionExists("sum"))
     assert(!sessionCatalog.isTemporaryFunction(FunctionIdentifier("sum")))
     
assert(!sessionCatalog.isTemporaryFunction(FunctionIdentifier("histogram_numeric")))
-    
assert(!sessionCatalog.isTemporaryFunction(FunctionIdentifier("percentile")))
   }
 
   test("drop function") {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to