Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-18464][SQL][backport] support old table which doesn't store schema in table properties #18963

Closed
wants to merge 1 commit into from

Conversation

cloud-fan
Copy link
Contributor

backport #18907 to branch 2.2

@SparkQA
Copy link

SparkQA commented Aug 16, 2017

Test build #80735 has finished for PR 18963 at commit 7964c9a.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class UnresolvedCatalogRelation(tableMeta: CatalogTable) extends LeafNode
  • case class HiveTableRelation(

…hema in table properties

This is a follow-up of apache#15900 , to fix one more bug:
When table schema is empty and need to be inferred at runtime, we should not resolve parent plans before the schema has been inferred, or the parent plans will be resolved against an empty schema and may get wrong result for something like `select *`

The fix logic is: introduce `UnresolvedCatalogRelation` as a placeholder. Then we replace it with `LogicalRelation` or `HiveTableRelation` during analysis, so that it's guaranteed that we won't resolve parent plans until the schema has been inferred.

regression test

Author: Wenchen Fan <wenchen@databricks.com>

Closes apache#18907 from cloud-fan/bug.
@cloud-fan
Copy link
Contributor Author

cc @gatorsmile , this patch conflicts with branch 2.1 a lot, is it ok we only backport to 2.2? I think this bug only occurs for a corner case and might be ok.

@gatorsmile
Copy link
Member

LGTM pending Jenkins

@SparkQA
Copy link

SparkQA commented Aug 16, 2017

Test build #80737 has finished for PR 18963 at commit c4e0fe3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class UnresolvedCatalogRelation(tableMeta: CatalogTable) extends LeafNode
  • case class HiveTableRelation(

asfgit pushed a commit that referenced this pull request Aug 16, 2017
…hema in table properties

backport #18907 to branch 2.2

Author: Wenchen Fan <wenchen@databricks.com>

Closes #18963 from cloud-fan/backport.
@gatorsmile
Copy link
Member

Thanks! Merged to 2.2

Cloud you close it?

@cloud-fan cloud-fan closed this Aug 17, 2017
MatthewRBruce pushed a commit to Shopify/spark that referenced this pull request Jul 31, 2018
…hema in table properties

backport apache#18907 to branch 2.2

Author: Wenchen Fan <wenchen@databricks.com>

Closes apache#18963 from cloud-fan/backport.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants