Skip to content

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

This reverts #21790 because it's no longer needed. It kept the original error from Hive when Spark loads builtin functions from Hive, which no longer happens as Spark has implemented all builtin functions natively.

Why are the changes needed?

code cleanup

Does this PR introduce any user-facing change?

No

How was this patch tested?

existing tests

@github-actions github-actions bot added the SQL label Sep 15, 2022
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not quite related but it's obviously redundant to try-catch and re-throw the error. externalCatalog.getFunction can throw NoSuchFunctionExcetion and we should just propagate it.

@cloud-fan
Copy link
Contributor Author

cloud-fan commented Sep 15, 2022

cc @caneGuy @dongjoon-hyun @MaxGekk

@cloud-fan
Copy link
Contributor Author

also cc @viirya

TableFunctionRegistry.builtin.functionExists(name)
}

protected[sql] def failFunctionLookup(
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, where do we set cause? As I see, we always call failFunctionLookup without cause (except for the test case).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We used to pass the cause parameter before, when looking up builtin functions from Hive. The code path is gone now.

Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

Looks good. The cause seems no real usage now.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

@cloud-fan . We need a new JIRA in this case to have a traceability. Could you file a JIRA issue for this reverting?

@viirya
Copy link
Member

viirya commented Sep 17, 2022

Oh, that's right. SPARK-24544 is long time ago, it is better to have a new JIRA.

@dongjoon-hyun
Copy link
Member

Let me create a JIRA for this.

@dongjoon-hyun dongjoon-hyun changed the title Revert [SPARK-24544][SQL] Print actual failure cause when look up function failed SPARK-40482: Revert [SPARK-24544][SQL] Print actual failure cause when look up function failed Sep 19, 2022
@dongjoon-hyun dongjoon-hyun changed the title SPARK-40482: Revert [SPARK-24544][SQL] Print actual failure cause when look up function failed [SPARK-40482][SQL] Revert SPARK-24544 Print actual failure cause when look up function failed Sep 19, 2022
…ysis/NoSuchItemException.scala

Co-authored-by: Liang-Chi Hsieh <[email protected]>
@cloud-fan
Copy link
Contributor Author

@dongjoon-hyun thanks for creating the JIRA ticket!

@cloud-fan
Copy link
Contributor Author

The last commit is just to remove s from s"...". I'm merging it to master, thanks for review!

@cloud-fan cloud-fan closed this in 127c403 Sep 19, 2022
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you!

LuciferYang pushed a commit to LuciferYang/spark that referenced this pull request Sep 20, 2022
…n look up function failed`

### What changes were proposed in this pull request?

This reverts apache#21790 because it's no longer needed. It kept the original error from Hive when Spark loads builtin functions from Hive, which no longer happens as Spark has implemented all builtin functions natively.

### Why are the changes needed?

code cleanup

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

existing tests

Closes apache#37896 from cloud-fan/error.

Lead-authored-by: Wenchen Fan <[email protected]>
Co-authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
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