Uh oh!
There was an error while loading. Please reload this page.
[SPARK-26946][SQL][FOLLOWUP] Require lookup function - #24689
Conversation
Treat it as catalog not found.
SparkQA
commented
May 23, 2019
Test build #105734 has finished for PR 24689 at commit
|
dongjoon-hyun
commented
May 26, 2019
Retest this please. |
SparkQA
commented
May 26, 2019
Test build #105799 has finished for PR 24689 at commit
|
jzhuge
commented
May 26, 2019
Removed commit |
SparkQA
commented
May 27, 2019
Test build #105806 has finished for PR 24689 at commit
|
Uh oh!
There was an error while loading. Please reload this page.
HyukjinKwon
left a comment
There was a problem hiding this comment.
Hey, @jzhuge, can we clarify what handling None means in PR description?
SparkQA
commented
May 27, 2019
Test build #105817 has finished for PR 24689 at commit
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rdblue
commented
May 27, 2019
@jzhuge, these changes look okay, but I think the right path is to always require a lookup function and get rid of the option. There is never a time when these should be used without a catalog lookup function and not requiring that one is supplied leads to avoidable errors. I've been testing a |
Well said @rdblue. I will proceed with the requirement of a lookup function. Since the interface is not widely used (yet), not too many places need update. |
SparkQA
commented
May 28, 2019
Test build #105857 has finished for PR 24689 at commit
|
jzhuge
commented
May 28, 2019
Not sure what the following failure is in test build #105857: |
SparkQA
commented
May 28, 2019
Test build #105877 has finished for PR 24689 at commit
|
| * [[UnresolvedRelation]]s into fully typed objects using information in a [[SessionCatalog]]. | ||
| */ | ||
| class Analyzer( | ||
| abstract class Analyzer( |
There was a problem hiding this comment.
Why not continue to pass a lookup function in some paths and default the analyzer to use one that throws CatalogNotFoundException? That would avoid a lot of these changes.
classAnalyzer(..., catalogLookup: String=>CatalogPlugin) {
defthis(...) = {
this(..., _ =>thrownewCatalogNotFoundException("Analyzer does not support multiple catalogs"))
}
}
overridedeflookupCatalog(name: String):CatalogPlugin= catalogLookup(name)There was a problem hiding this comment.
Reverted commit Make Analyzer abstract and add TestAnalyzer to minimize changes to test classes.
If you feel strongly, I can add the 4th parameter override val lookupCatalog: String => CatalogPlugin to Analyzer constructor. Although users can override in the following manner:
new Analyzer() {
override def lookupCatalog(name: String): CatalogPlugin = ???
}
This reverts commit 0f73998.
SparkQA
commented
May 29, 2019
Test build #105884 has finished for PR 24689 at commit
|
Looks good to me. One minor comment: it doesn't look like Analyzer implementations created in BaseSessionStateBuilder actually override the lookup method to call the session's catalog lookup. I would probably include that in this PR, but we can also add it in later PRs when it is used. +1, I think this is ready to merge either way. @cloud-fan, @dongjoon-hyun, @HyukjinKwon, could you take a look at this DSv2 PR? Thanks! |
cloud-fan
commented
May 30, 2019
LGTM, merging to master! |
jzhuge
commented
May 30, 2019
Thanks @HyukjinKwon@rdblue@cloud-fan ! |
## What changes were proposed in this pull request?
Require the lookup function with interface LookupCatalog. Rationale is in the review comments below.
Make `Analyzer` abstract. BaseSessionStateBuilder and HiveSessionStateBuilder implements lookupCatalog with a call to SparkSession.catalog().
Existing test cases and those that don't need catalog lookup will use a newly added `TestAnalyzer` with a default lookup function that throws` CatalogNotFoundException("No catalog lookup function")`.
Rewrote the unit test for LookupCatalog to demonstrate the interface can be used anywhere, not just Analyzer.
Removed Analyzer parameter `lookupCatalog` because we can override in the following manner:
```
new Analyzer() {
override def lookupCatalog(name: String): CatalogPlugin = ???
}
```
## How was this patch tested?
Existing unit tests.
Closesapache#24689 from jzhuge/SPARK-26946-follow.
Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
Require the lookup function with interface LookupCatalog. Rationale is in the review comments below.
Make
Analyzerabstract. BaseSessionStateBuilder and HiveSessionStateBuilder implements lookupCatalog with a call to SparkSession.catalog().Existing test cases and those that don't need catalog lookup will use a newly added
TestAnalyzerwith a default lookup function that throwsCatalogNotFoundException("No catalog lookup function").Rewrote the unit test for LookupCatalog to demonstrate the interface can be used anywhere, not just Analyzer.
Removed Analyzer parameter
lookupCatalogbecause we can override in the following manner:How was this patch tested?
Existing unit tests.