Skip to content

[SPARK-30040][SQL] DROP FUNCTION should do multi-catalog resolution#26854

Closed
planga82 wants to merge 3 commits intoapache:masterfrom
planga82:feature/SPARK-30040_DropFunctionV2Catalog
Closed

[SPARK-30040][SQL] DROP FUNCTION should do multi-catalog resolution#26854
planga82 wants to merge 3 commits intoapache:masterfrom
planga82:feature/SPARK-30040_DropFunctionV2Catalog

Conversation

@planga82
Copy link
Contributor

What changes were proposed in this pull request?

Add DropFunctionStatement and make DROP FUNCTION go through the same catalog/table resolution framework of v2 commands.

Why are the changes needed?

It's important to make all the commands have the same table resolution behavior, to avoid confusing
DROP FUNCTION namespace.function

Does this PR introduce any user-facing change?

Yes. When running DROP FUNCTION namespace.function Spark fails the command if the current catalog is set to a v2 catalog.

How was this patch tested?

Unit tests.

@planga82
Copy link
Contributor Author

ShowFunctionsCommand(database, function, userScope, systemScope)

case DropFunctionStatement(
CatalogAndIdentifier(catalog, functionIdent), ifExists, isTemp) =>
Copy link
Contributor

@imback82 imback82 Dec 12, 2019

Choose a reason for hiding this comment

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

nit: This can go to the previous line.

    case DropFunctionStatement(CatalogAndIdentifier(catalog, functionIdent), ifExists, isTemp) =>

@dongjoon-hyun
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented Dec 12, 2019

Test build #115201 has finished for PR 26854 at commit b4b021e.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class DropFunctionStatement(

@SparkQA
Copy link

SparkQA commented Dec 12, 2019

Test build #115215 has finished for PR 26854 at commit 8e96386.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

}

/**
* Create a [[DropFunctionCommand]] statement.
Copy link
Member

Choose a reason for hiding this comment

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

DropFunctionCommand -> DropFunctionStatement?

Copy link
Member

Choose a reason for hiding this comment

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

Create a plan for a DROP FUNCTION statement. will be better here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thanks!

ShowFunctionsCommand(database, function, userScope, systemScope)

case DropFunctionStatement(CatalogAndIdentifier(catalog, functionIdent), ifExists, isTemp) =>
if (isSessionCatalog(catalog)) {
Copy link
Member

@dongjoon-hyun dongjoon-hyun Dec 12, 2019

Choose a reason for hiding this comment

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

indentation from 508 to 518.

Copy link
Contributor

@imback82 imback82 left a comment

Choose a reason for hiding this comment

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

LGTM (once @dongjoon-hyun's comments are resolved)

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 after resolving @dongjoon-hyun's comments and few style comments.

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.

@dongjoon-hyun
Copy link
Member

Merged to master.

@SparkQA
Copy link

SparkQA commented Dec 12, 2019

Test build #115252 has finished for PR 26854 at commit 93cb138.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

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.

6 participants