Skip to content

Conversation

@imback82
Copy link
Contributor

@imback82 imback82 commented Feb 3, 2021

What changes were proposed in this pull request?

This is a follow up to #31424, and proposes to use UnresolvedTable.relationTypeMismatchHint when UnresolvedTable is resolved to a temp view.

Why are the changes needed?

This change utilizes the type mismatch hint when a relation is resolved to a temp view when a table is expected.

For example, ALTER TABLE tmpView SET TBLPROPERTIES ('p' = 'an') will now include Please use ALTER VIEW instead. in the exception message: tmpView is a temp view. 'ALTER TABLE ... SET TBLPROPERTIES' expects a table. Please use ALTER VIEW instead.

Does this PR introduce any user-facing change?

Yes, adds the hint in the exception message.

How was this patch tested?

Update existing tests to include the hint.

s"$quoted as it's not a data source v2 relation.")
}

def expectTableNotTempViewError(quoted: String, cmd: String, t: TreeNode[_]): Throwable = {
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 can just reuse expectTableNotViewError if we pass ResolvedView.

@SparkQA
Copy link

SparkQA commented Feb 3, 2021

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

@SparkQA
Copy link

SparkQA commented Feb 3, 2021

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

@github-actions github-actions bot added the SQL label Feb 3, 2021
@SparkQA
Copy link

SparkQA commented Feb 3, 2021

Test build #134813 has finished for PR 31452 at commit 63ed2c3.

  • 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 3d7e139 Feb 3, 2021
skestle pushed a commit to skestle/spark that referenced this pull request Feb 3, 2021
…olvedTable is resolved to a temp view

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

This is a follow up to apache#31424, and proposes to use `UnresolvedTable.relationTypeMismatchHint` when `UnresolvedTable` is resolved to a temp view.

### Why are the changes needed?

This change utilizes the type mismatch hint when a relation is resolved to a temp view when a table is expected.

For example, `ALTER TABLE tmpView SET TBLPROPERTIES ('p' = 'an')` will now include `Please use ALTER VIEW instead.` in the exception message: `tmpView is a temp view. 'ALTER TABLE ... SET TBLPROPERTIES' expects a table. Please use ALTER VIEW instead.`

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

Yes, adds the hint in the exception message.

### How was this patch tested?

Update existing tests to include the hint.

Closes apache#31452 from imback82/followup_SPARK-34317.

Authored-by: Terry Kim <[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