Skip to content

Conversation

@LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Jan 6, 2021

What changes were proposed in this pull request?

There is one compilation warning as follow:

[WARNING] [Warn] /spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:1555: [other-match-analysis @ org.apache.spark.sql.catalyst.catalog.SessionCatalog.lookupFunction.catalogFunction] unreachable code

This compilation warning is due to NoSuchPermanentFunctionException is sub-class of AnalysisException and if there is NoSuchPermanentFunctionException be thrown out, it will be catch by case _: AnalysisException => failFunctionLookup(name), so case _: NoSuchPermanentFunctionException => failFunctionLookup(name) is unreachable code.

This pr remove case _: NoSuchPermanentFunctionException => failFunctionLookup(name) directly because both these 2 branches handle exceptions in the same way: failFunctionLookup(name)

Why are the changes needed?

Cleanup "unreachable code" compilation warnings.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass the Jenkins or GitHub Action

@SparkQA
Copy link

SparkQA commented Jan 6, 2021

Test build #133737 has finished for PR 31064 at commit 8942881.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jan 6, 2021

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

@SparkQA
Copy link

SparkQA commented Jan 6, 2021

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

@LuciferYang LuciferYang changed the title [SPARK-34028][SQL] Cleanup "unreachable code" compilation warnings [SPARK-34028][SQL] Cleanup "unreachable code" compilation warning Jan 6, 2021
@github-actions github-actions bot added the SQL label Jan 6, 2021
Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It's a strictly a followup of Okay, it's from 5c8fad7.

@HyukjinKwon
Copy link
Member

Merged to master.

@LuciferYang
Copy link
Contributor Author

thx ~ @HyukjinKwon

@LuciferYang LuciferYang deleted the SPARK-34028 branch June 6, 2022 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants