You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/12/08 03:49:42 UTC

[GitHub] [spark] linhongliu-db opened a new pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

linhongliu-db opened a new pull request #30662:
URL: https://github.com/apache/spark/pull/30662


   ### What changes were proposed in this pull request?
   Using the view captured catalog and namespace to lookup function, so the view
   referred functions won't be overridden by newly created function with the same name,
   but different database or function type (i.e. temporary function)
   
   
   ### Why are the changes needed?
   bug fix, without this PR, changing database or create a temporary function with
   the same name may cause failure when querying a view.
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, bug fix.
   
   
   ### How was this patch tested?
   newly added and existing test cases.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] linhongliu-db commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
linhongliu-db commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539362189



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -114,7 +114,8 @@ case class AnalysisContext(
     nestedViewDepth: Int = 0,
     maxNestedViewDepth: Int = -1,
     relationCache: mutable.Map[Seq[String], LogicalPlan] = mutable.Map.empty,
-    referredTempViewNames: Seq[Seq[String]] = Seq.empty)
+    referredTempViewNames: Seq[Seq[String]] = Seq.empty,
+    isTempView: Boolean = false)

Review comment:
       if we change the type to `referredTempFuncNames: Option[Seq[String]]`, then it can replace `isTempView`. Because Seq.empty can be permanent view or temp view refers non temp functions.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539048156



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSQLViewSuite.scala
##########
@@ -72,9 +73,13 @@ class HiveSQLViewSuite extends SQLViewSuite with TestHiveSingleton {
           withTable("tab1") {
             (1 to 10).map(i => s"$i").toDF("id").write.saveAsTable("tab1")
 
-            // temporary view
-            sql(s"CREATE TEMPORARY VIEW tempView1 AS SELECT $tempFunctionName(id) from tab1")
-            checkAnswer(sql("select count(*) FROM tempView1"), Row(10))
+            // TODO: temporary function support for temporary view with sql text stored will

Review comment:
       nit: `TODO (SPARK-XXX): support temporary functions in temp views`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741567635


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132455/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742220450


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37134/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740505698


   **[Test build #132423 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132423/testReport)** for PR 30662 at commit [`00e32d6`](https://github.com/apache/spark/commit/00e32d6c5b2043857cfee98449f6a0f8012db9d9).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740657522


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132430/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741664234


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37078/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740357264


   **[Test build #132405 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132405/testReport)** for PR 30662 at commit [`f3c2fd6`](https://github.com/apache/spark/commit/f3c2fd6530d9335c7ae92ebd53a9ad8731b28f44).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742339061


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37150/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742339061


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37150/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740928811


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132436/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740788258


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37037/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742223436


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37131/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741664211


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37078/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539046988



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
##########
@@ -1488,12 +1488,28 @@ class SessionCatalog(
     // We probably shouldn't use a single FunctionRegistry to register all three kinds of functions
     // (built-in, temp, and external).
     if (name.database.isEmpty && functionRegistry.functionExists(name)) {
-      // This function has been already loaded into the function registry.
-      return functionRegistry.lookupFunction(name, children)
+      val isResolvingView = AnalysisContext.get.catalogAndNamespace.nonEmpty
+      // We lookup function without database in two cases:
+      // 1. the function is not a temporary function
+      // 2. the function is a temporary function but we are not resolving view
+      if (!isTemporaryFunction(name) || !isResolvingView) {
+        // This function has been already loaded into the function registry.
+        return functionRegistry.lookupFunction(name, children)
+      }
+    }
+
+    // Get the database from AnalysisContext if it's defined, otherwise, use current database
+    val currentDatabase = AnalysisContext.get.catalogAndNamespace match {
+      case Seq() => getCurrentDatabase
+      case Seq(_, db) => db
+      case Seq(catalog, namespace @ _*) =>
+        throw new AnalysisException(
+          s"Unsupported catalog ${catalog} and " +

Review comment:
       we can just say: `V2 catalog does not support functions yet`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740369219


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37005/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741649406


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37078/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741507870


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37056/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742204857


   **[Test build #132532 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132532/testReport)** for PR 30662 at commit [`b30272c`](https://github.com/apache/spark/commit/b30272c61953cddbea2815d19c05e3feacd06344).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742223419


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37131/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740417599


   **[Test build #132414 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132414/testReport)** for PR 30662 at commit [`c104cfe`](https://github.com/apache/spark/commit/c104cfe01af27514324393cf8b8742a38220ad55).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740394761


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132405/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741718747


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132476/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740657522


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132430/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740482721


   **[Test build #132414 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132414/testReport)** for PR 30662 at commit [`c104cfe`](https://github.com/apache/spark/commit/c104cfe01af27514324393cf8b8742a38220ad55).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741507877


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37056/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742235759


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37134/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742306073


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37150/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740647085


   **[Test build #132430 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132430/testReport)** for PR 30662 at commit [`00e32d6`](https://github.com/apache/spark/commit/00e32d6c5b2043857cfee98449f6a0f8012db9d9).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740483164


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132414/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740529933


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37023/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742235759


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37134/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741567635


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132455/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740448638


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37014/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740448659


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37014/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539047178



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
##########
@@ -1488,12 +1488,28 @@ class SessionCatalog(
     // We probably shouldn't use a single FunctionRegistry to register all three kinds of functions
     // (built-in, temp, and external).
     if (name.database.isEmpty && functionRegistry.functionExists(name)) {
-      // This function has been already loaded into the function registry.
-      return functionRegistry.lookupFunction(name, children)
+      val isResolvingView = AnalysisContext.get.catalogAndNamespace.nonEmpty
+      // We lookup function without database in two cases:
+      // 1. the function is not a temporary function

Review comment:
       `the function is built-in`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] linhongliu-db commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
linhongliu-db commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740685253


   retest this please


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740543692


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37023/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740437195


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37014/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742216131


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37131/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539854029



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
##########
@@ -1488,12 +1488,32 @@ class SessionCatalog(
     // We probably shouldn't use a single FunctionRegistry to register all three kinds of functions
     // (built-in, temp, and external).
     if (name.database.isEmpty && functionRegistry.functionExists(name)) {
-      // This function has been already loaded into the function registry.
-      return functionRegistry.lookupFunction(name, children)
+      val referredTempFunctionNames = AnalysisContext.get.referredTempFunctionNames
+      val isResolvingView = AnalysisContext.get.catalogAndNamespace.nonEmpty
+      // We lookup function without database in three cases:
+      // 1. the function is not a temporary function
+      // 2. the function is a temporary function but we are not resolving view
+      // 3. we are resolving a view and the function is a temporary function referred by this view
+      if (!isTemporaryFunction(name) ||
+        !isResolvingView ||
+        referredTempFunctionNames.contains(name.funcName)) {
+        // This function has been already loaded into the function registry.
+        return functionRegistry.lookupFunction(name, children)
+      }
+    }
+
+    // Get the database from AnalysisContext if it's defined, otherwise, use current database
+    val currentDatabase = AnalysisContext.get.catalogAndNamespace match {
+      case Seq() => getCurrentDatabase
+      case Seq(_, db) => db
+      case Seq(catalog, namespace @ _*) =>
+        throw new AnalysisException(
+          s"V2 catalog does not support functions yet. " +
+            s"catalog: ${catalog}, namespace '${namespace.mkString("[", ".", "]")}'")

Review comment:
       nit: `namespace.quoted`. We need to import `CatalogV2Implicits._` first.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741563256


   **[Test build #132455 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132455/testReport)** for PR 30662 at commit [`ef7c6b2`](https://github.com/apache/spark/commit/ef7c6b2babfdcfa7a2c3303eadaea2791c8a8ed1).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan closed pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #30662:
URL: https://github.com/apache/spark/pull/30662


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741489567


   **[Test build #132455 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132455/testReport)** for PR 30662 at commit [`ef7c6b2`](https://github.com/apache/spark/commit/ef7c6b2babfdcfa7a2c3303eadaea2791c8a8ed1).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740543669


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37023/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] linhongliu-db commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
linhongliu-db commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742389014


   retest this please


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742223436


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37131/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740594444


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37030/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740583913


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37030/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539406270



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -114,7 +114,8 @@ case class AnalysisContext(
     nestedViewDepth: Int = 0,
     maxNestedViewDepth: Int = -1,
     relationCache: mutable.Map[Seq[String], LogicalPlan] = mutable.Map.empty,
-    referredTempViewNames: Seq[Seq[String]] = Seq.empty)
+    referredTempViewNames: Seq[Seq[String]] = Seq.empty,
+    isTempView: Boolean = false)

Review comment:
       yea let's do it then. We can use `isTempView: Boolean = false` in the backport PR of 3.0/2.4.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740537321


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132423/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539358200



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -114,7 +114,8 @@ case class AnalysisContext(
     nestedViewDepth: Int = 0,
     maxNestedViewDepth: Int = -1,
     relationCache: mutable.Map[Seq[String], LogicalPlan] = mutable.Map.empty,
-    referredTempViewNames: Seq[Seq[String]] = Seq.empty)
+    referredTempViewNames: Seq[Seq[String]] = Seq.empty,
+    isTempView: Boolean = false)

Review comment:
       then shall we just use `referredTempFuncNames`?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740744950


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37037/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741489567


   **[Test build #132455 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132455/testReport)** for PR 30662 at commit [`ef7c6b2`](https://github.com/apache/spark/commit/ef7c6b2babfdcfa7a2c3303eadaea2791c8a8ed1).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] linhongliu-db commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
linhongliu-db commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539362189



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -114,7 +114,8 @@ case class AnalysisContext(
     nestedViewDepth: Int = 0,
     maxNestedViewDepth: Int = -1,
     relationCache: mutable.Map[Seq[String], LogicalPlan] = mutable.Map.empty,
-    referredTempViewNames: Seq[Seq[String]] = Seq.empty)
+    referredTempViewNames: Seq[Seq[String]] = Seq.empty,
+    isTempView: Boolean = false)

Review comment:
       if we change the type to referredTempFuncNames: Option[Seq[String]], then it can replace `isTempView`. Because Seq.empty can be permanent view or temp view refers non temp functions.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742292485


   **[Test build #132532 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132532/testReport)** for PR 30662 at commit [`b30272c`](https://github.com/apache/spark/commit/b30272c61953cddbea2815d19c05e3feacd06344).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741507877


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37056/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740388643


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37005/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539854837



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewTestSuite.scala
##########
@@ -199,6 +199,33 @@ abstract class SQLViewTestSuite extends QueryTest with SQLTestUtils {
       }
     }
   }
+
+  test("SPARK-33692: view should use captured catalog and namespace to lookup function") {
+    val avgFuncClass = "test.org.apache.spark.sql.MyDoubleAvg"
+    val sumFuncClass = "test.org.apache.spark.sql.MyDoubleSum"
+    val functionName = "test_udf"
+    withTempDatabase { dbName =>
+      withUserDefinedFunction(
+        s"default.$functionName" -> false,
+        s"$dbName.$functionName" -> false,
+        functionName -> true) {
+        // create a function in default database
+        sql("USE DEFAULT")
+        sql(s"CREATE FUNCTION $functionName AS '$avgFuncClass'")
+        // create a view using a function in 'default' database
+        val viewName = createView("v1", s"SELECT $functionName(col1) FROM VALUES (1), (2), (3)")
+        // create function in another database with the same function name
+        sql(s"USE $dbName")
+        sql(s"CREATE FUNCTION $functionName AS '$sumFuncClass'")
+        // create temporary function with the same function name
+        sql(s"CREATE TEMPORARY FUNCTION $functionName AS '$sumFuncClass'")
+        withView(viewName) {
+          // view v1 should still using function defined in `default` database
+          checkViewOutput(viewName, Seq(Row(102.0)))

Review comment:
       The avg should be `2.0`, isn't it?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] linhongliu-db commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
linhongliu-db commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539091929



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSQLViewSuite.scala
##########
@@ -72,9 +73,13 @@ class HiveSQLViewSuite extends SQLViewSuite with TestHiveSingleton {
           withTable("tab1") {
             (1 to 10).map(i => s"$i").toDF("id").write.saveAsTable("tab1")
 
-            // temporary view
-            sql(s"CREATE TEMPORARY VIEW tempView1 AS SELECT $tempFunctionName(id) from tab1")
-            checkAnswer(sql("select count(*) FROM tempView1"), Row(10))
+            // TODO: temporary function support for temporary view with sql text stored will

Review comment:
       yeah, but there are also test failure in udf-inner-join.sql related to temp function in temp views. I changed to another way to find these test cases. could you check again?
   https://github.com/apache/spark/pull/30662/files#diff-ed19f376a63eba52eea59ca71f3355d4495fad4fad4db9a3324aade0d4986a47R118
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742380250


   **[Test build #132546 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132546/testReport)** for PR 30662 at commit [`632f3d6`](https://github.com/apache/spark/commit/632f3d6cd7b8cc9d3fe46741d191cf4cd659eced).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742254965


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132531/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740765534


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37037/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742380885


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132546/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742219873






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742279741


   **[Test build #132546 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132546/testReport)** for PR 30662 at commit [`632f3d6`](https://github.com/apache/spark/commit/632f3d6cd7b8cc9d3fe46741d191cf4cd659eced).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740546104


   **[Test build #132430 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132430/testReport)** for PR 30662 at commit [`00e32d6`](https://github.com/apache/spark/commit/00e32d6c5b2043857cfee98449f6a0f8012db9d9).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740928811


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132436/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740546104


   **[Test build #132430 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132430/testReport)** for PR 30662 at commit [`00e32d6`](https://github.com/apache/spark/commit/00e32d6c5b2043857cfee98449f6a0f8012db9d9).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740537321


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132423/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742380885


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132546/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742204857


   **[Test build #132532 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132532/testReport)** for PR 30662 at commit [`b30272c`](https://github.com/apache/spark/commit/b30272c61953cddbea2815d19c05e3feacd06344).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741623909


   **[Test build #132476 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132476/testReport)** for PR 30662 at commit [`11523f4`](https://github.com/apache/spark/commit/11523f4e43bfcd5f96b61a88e980ff585324dd66).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742339007


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37150/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742251011


   **[Test build #132531 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132531/testReport)** for PR 30662 at commit [`a8c7722`](https://github.com/apache/spark/commit/a8c7722332796bbd622778a55573b17d73f74dd2).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r538941692



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/UDFSuite.scala
##########
@@ -209,4 +209,32 @@ class UDFSuite
       assert(e.getMessage.contains("Can not get an evaluator of the empty UDAF"))
     }
   }
+
+  test("permanent view should use captured catalog and namespace for function") {

Review comment:
       Shall we add a JIRA prefix in the test title @linhongliu-db?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740697651


   **[Test build #132436 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132436/testReport)** for PR 30662 at commit [`00e32d6`](https://github.com/apache/spark/commit/00e32d6c5b2043857cfee98449f6a0f8012db9d9).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740483164


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132414/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] linhongliu-db commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
linhongliu-db commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740545104


   retest this please


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742323436


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132532/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742279741


   **[Test build #132546 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132546/testReport)** for PR 30662 at commit [`632f3d6`](https://github.com/apache/spark/commit/632f3d6cd7b8cc9d3fe46741d191cf4cd659eced).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742219906


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37135/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742254965


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132531/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742219906


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37135/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] linhongliu-db commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
linhongliu-db commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539085846



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
##########
@@ -1488,12 +1488,28 @@ class SessionCatalog(
     // We probably shouldn't use a single FunctionRegistry to register all three kinds of functions
     // (built-in, temp, and external).
     if (name.database.isEmpty && functionRegistry.functionExists(name)) {
-      // This function has been already loaded into the function registry.
-      return functionRegistry.lookupFunction(name, children)
+      val isResolvingView = AnalysisContext.get.catalogAndNamespace.nonEmpty
+      // We lookup function without database in two cases:
+      // 1. the function is not a temporary function

Review comment:
       there are also external functions, in `isTemporaryFunction`:
   ```
       name.database.isEmpty &&
         functionRegistry.functionExists(name) &&
         !FunctionRegistry.builtin.functionExists(name) &&
         !hiveFunctions.contains(name.funcName.toLowerCase(Locale.ROOT))
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740594444


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37030/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740357264


   **[Test build #132405 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132405/testReport)** for PR 30662 at commit [`f3c2fd6`](https://github.com/apache/spark/commit/f3c2fd6530d9335c7ae92ebd53a9ad8731b28f44).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741718747


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132476/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741664234


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37078/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742201143


   **[Test build #132531 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132531/testReport)** for PR 30662 at commit [`a8c7722`](https://github.com/apache/spark/commit/a8c7722332796bbd622778a55573b17d73f74dd2).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742228191


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37134/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740788258


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37037/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740543692


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37023/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742201143


   **[Test build #132531 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132531/testReport)** for PR 30662 at commit [`a8c7722`](https://github.com/apache/spark/commit/a8c7722332796bbd622778a55573b17d73f74dd2).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740448659


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37014/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741500383


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37056/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740417599


   **[Test build #132414 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132414/testReport)** for PR 30662 at commit [`c104cfe`](https://github.com/apache/spark/commit/c104cfe01af27514324393cf8b8742a38220ad55).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742389179


   The failed 3 tests are the well known flaky tests from the thrift-server module. I'm merging it to master/3.1, thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740376656


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37005/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741718307


   **[Test build #132476 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132476/testReport)** for PR 30662 at commit [`11523f4`](https://github.com/apache/spark/commit/11523f4e43bfcd5f96b61a88e980ff585324dd66).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740388643


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/37005/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-741623909


   **[Test build #132476 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132476/testReport)** for PR 30662 at commit [`11523f4`](https://github.com/apache/spark/commit/11523f4e43bfcd5f96b61a88e980ff585324dd66).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740394761


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132405/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740394613


   **[Test build #132405 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132405/testReport)** for PR 30662 at commit [`f3c2fd6`](https://github.com/apache/spark/commit/f3c2fd6530d9335c7ae92ebd53a9ad8731b28f44).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740571434


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37030/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740927105


   **[Test build #132436 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132436/testReport)** for PR 30662 at commit [`00e32d6`](https://github.com/apache/spark/commit/00e32d6c5b2043857cfee98449f6a0f8012db9d9).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740697651


   **[Test build #132436 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132436/testReport)** for PR 30662 at commit [`00e32d6`](https://github.com/apache/spark/commit/00e32d6c5b2043857cfee98449f6a0f8012db9d9).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] linhongliu-db commented on a change in pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
linhongliu-db commented on a change in pull request #30662:
URL: https://github.com/apache/spark/pull/30662#discussion_r539805347



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -114,7 +114,8 @@ case class AnalysisContext(
     nestedViewDepth: Int = 0,
     maxNestedViewDepth: Int = -1,
     relationCache: mutable.Map[Seq[String], LogicalPlan] = mutable.Map.empty,
-    referredTempViewNames: Seq[Seq[String]] = Seq.empty)
+    referredTempViewNames: Seq[Seq[String]] = Seq.empty,
+    isTempView: Boolean = false)

Review comment:
       you are correct in the first comment. we can just use `referredTempFunctionNames`. But this approach will fix both permanent and temp view problems, which I was planning to fix them separately. Anyway, I switch to use `referredTempFunctionNames` in the latest commit.
   
   BTW, in 3.0/2.4, temp view stores analyzed plan, and won't be wrapped in `View`, so we don't need the `isTempView` flag.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740535426


   **[Test build #132423 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132423/testReport)** for PR 30662 at commit [`00e32d6`](https://github.com/apache/spark/commit/00e32d6c5b2043857cfee98449f6a0f8012db9d9).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-742323436


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/132532/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #30662: [SPARK-33692][SQL] View should use captured catalog and namespace to lookup function

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30662:
URL: https://github.com/apache/spark/pull/30662#issuecomment-740505698


   **[Test build #132423 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/132423/testReport)** for PR 30662 at commit [`00e32d6`](https://github.com/apache/spark/commit/00e32d6c5b2043857cfee98449f6a0f8012db9d9).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org