Skip to content

Conversation

@huaxingao
Copy link
Contributor

What changes were proposed in this pull request?

fixed a few problems:

  1. addressed this comment
  2. combined several xxxOnlySupportedWithV2TableError
  3. in CTAS and RTAS, the if isSessionCatalog(catalog) should not be on the pattern, it should be if (isSessionCatalog(catalog) && !isV2Provider(provider)). Otherwise, c.partitioning ++ c.tableSpec.bucketSpec.map(_.asTransform) is not done for non SessionCatalog case.
    I tried this c.partitioning ++ c.tableSpec.bucketSpec.map(_.asTransform) inside AstBuilder but it failed here so I kept this in ResolveSessionCatalog

Why are the changes needed?

code cleaning up and bug fixing

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing tests

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

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

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

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

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

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

@huaxingao
Copy link
Contributor Author

@cloud-fan could you please take a look when you have a chance?

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

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

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

Test build #146057 has finished for PR 34857 at commit b349352.

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

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

Test build #146060 has finished for PR 34857 at commit 7795d04.

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

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

Test build #146073 has finished for PR 34857 at commit 4e1d2e0.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

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

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

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

RefreshFunctionCommand(funcIdentifier.database, funcIdentifier.funcName)
}

private def constructTableV1Cmd(
Copy link
Member

Choose a reason for hiding this comment

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

nit: constructV1TableCmd?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


def alterQualifiedColumnOnlySupportedWithV2TableError(): Throwable = {
new AnalysisException("ALTER COLUMN with qualified column is only supported with v2 tables.")
def operationOnlySupportedWithV2TableError(message: String): Throwable = {
Copy link
Member

Choose a reason for hiding this comment

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

nit: message -> command or operation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. thanks

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

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

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

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

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

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

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

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

@SparkQA
Copy link

SparkQA commented Dec 10, 2021

Test build #146074 has finished for PR 34857 at commit a1bae12.

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

@SparkQA
Copy link

SparkQA commented Dec 11, 2021

Test build #146077 has finished for PR 34857 at commit 765b8a3.

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


case c @ ReplaceTableAsSelect(ResolvedDBObjectName(catalog, _), _, _, _, _, _)
if isSessionCatalog(catalog) =>
case c @ ReplaceTableAsSelect(ResolvedDBObjectName(catalog, _), _, _, _, _, _) =>
Copy link
Member

Choose a reason for hiding this comment

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

So seems we don't have test for this case? Otherwise previously wrongly placed isSessionCatalog(catalog) should be detected?

@SparkQA
Copy link

SparkQA commented Dec 11, 2021

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

@SparkQA
Copy link

SparkQA commented Dec 11, 2021

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

@SparkQA
Copy link

SparkQA commented Dec 11, 2021

Test build #146099 has finished for PR 34857 at commit 39874c4.

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

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

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

LGTM

}
}

test("SPARK-34857: ReplaceTableAsSelect partitions can be specified using " +
Copy link
Member

Choose a reason for hiding this comment

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

@SparkQA
Copy link

SparkQA commented Dec 12, 2021

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

@viirya viirya changed the title [SPARK-36850][SQL][FOLLOWUP] Code clean up [SPARK-36850][SQL][FOLLOWUP] Simplify exception code and fix wrong condition for CTAS and RTAS Dec 12, 2021
@SparkQA
Copy link

SparkQA commented Dec 12, 2021

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

@SparkQA
Copy link

SparkQA commented Dec 13, 2021

Test build #146110 has finished for PR 34857 at commit 1cc6c33.

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

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 1cc1459 Dec 13, 2021
@huaxingao
Copy link
Contributor Author

Thank you all so much!

@huaxingao huaxingao deleted the followup branch December 13, 2021 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants