Skip to content

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

DROP/REFRESH FUNCTION commands only need to know the qualified function name, or if the function is builtin/temp, then call catalog APIs to finish the work. This PR refactors Drop/RefreshFunction to use UnresolvedIdentifier and ResolveIdentifier, following DropTable, to eliminate the unnecessary catalog lookup.

Why are the changes needed?

Save unnecessary catalog RPC for function lookup.

Does this PR introduce any user-facing change?

no

How was this patch tested?

existing tests

Was this patch authored or co-authored using generative AI tooling?

cursor 2.2.44

@github-actions github-actions bot added the SQL label Dec 29, 2025
@cloud-fan cloud-fan marked this pull request as ready for review December 29, 2025 18:18
@cloud-fan cloud-fan force-pushed the drop_func branch 3 times, most recently from 013ea84 to 4c5ef47 Compare December 30, 2025 14:56
val sessionCatalog = catalogManager.v1SessionCatalog
if (sessionCatalog.isBuiltinFunction(funcName)) {
val ident = Identifier.of(Array(CatalogManager.BUILTIN_NAMESPACE), nameParts.head)
ResolvedIdentifier(FakeSystemCatalog, ident)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is FakeSystemCatalog?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a virtual catalog to help ResolvedIdentifier represent fully qualified names for temp/builtin objects. Otherwise the v2 command framework can't work with them. You can check the usage of FakeSystemCatalog, it has been used in a few places already.

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.

2 participants