Skip to content

Commit

Permalink
[SPARK-32677][SQL][DOCS][MINOR] Improve code comment in CreateFunctio…
Browse files Browse the repository at this point in the history
…nCommand

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

We made a mistake in #29502, as there is no code comment to explain why we can't load the UDF class when creating functions. This PR improves the code comment.

### Why are the changes needed?

To avoid making the same mistake.

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

No

### How was this patch tested?

N/A

Closes #29713 from cloud-fan/comment.

Authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
  • Loading branch information
cloud-fan authored and maropu committed Sep 11, 2020
1 parent 5f468cc commit 328d81a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ case class CreateFunctionCommand(
} else {
// For a permanent, we will store the metadata into underlying external catalog.
// This function will be loaded into the FunctionRegistry when a query uses it.
// We do not load it into FunctionRegistry right now.
// We do not load it into FunctionRegistry right now, to avoid loading the resource and
// UDF class immediately, as the Spark application to create the function may not have
// access to the resource and/or UDF class.
catalog.createFunction(func, ignoreIfExists)
}
}
Expand Down

0 comments on commit 328d81a

Please sign in to comment.