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

[SQL][SPARK-7088] Fix analysis for 3rd party logical plan. #6853

Closed
wants to merge 1 commit into from

Conversation

smola
Copy link
Contributor

@smola smola commented Jun 17, 2015

ResolveReferences analysis rule now does not throw when it cannot resolve references in a self-join.

@smola
Copy link
Contributor Author

smola commented Jun 17, 2015

This is still a work in progress, since I have not tested yet.

@marmbrus
Copy link
Contributor

If I understand correctly, you are just delaying the failure until checkAnalysis. A few followup questions: does that mean you don't check analysis in your code path? Does your custom logical plan produce new attribute references?

@marmbrus
Copy link
Contributor

ok to test

@SparkQA
Copy link

SparkQA commented Jun 17, 2015

Test build #35063 has finished for PR 6853 at commit c8c382a.

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

@rxin
Copy link
Contributor

rxin commented Jun 18, 2015

@smola can you put WIP on the title until you feel it is ready?

@smola smola changed the title [SQL][SPARK-7088] Fix analysis for 3rd party logical plan. [WIP][SQL][SPARK-7088] Fix analysis for 3rd party logical plan. Jun 18, 2015
@smola
Copy link
Contributor Author

smola commented Jun 18, 2015

@marmbrus Yes, this patch is meant just to delay the check until check analysis. The reason is that just because ResolveReferences rule cannot resolve the plan, that does not mean that there is no other rule resolving it. I think this is the main idea behind how rules work in catalyst, right? Each rule takes care of what it knows and ignores the unknown.

With respect my use case, my custom logical plan does produce new attributes. I have also added resolution rules for it on my side. So yes, analysis is checked. But the current problem with this is that I need to maintain a copy of ResolveReferences (i.e. FixedResolveReferences) in my code, instead of just adding my new logic in ResolveMyCustomPlan. Then I have to override SQLContext and the analyzer just to be able to replace the default rule with mine.

case j @ Join(left, right, _, _) if left.outputSet.intersect(right.outputSet).nonEmpty =>
val conflictingAttributes = left.outputSet.intersect(right.outputSet)
failAnalysis(s"""
|Failure when resolving conflicting references in Join:
Copy link
Contributor

Choose a reason for hiding this comment

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

fix alignment here.

@marmbrus
Copy link
Contributor

Thanks for the explanation, that does sound reasonable to me. A few minor suggestions otherwise LGTM.

ResolveReferences analysis rule now does not throw when
it cannot resolve references in a self-join.
@smola smola changed the title [WIP][SQL][SPARK-7088] Fix analysis for 3rd party logical plan. [SQL][SPARK-7088] Fix analysis for 3rd party logical plan. Jun 24, 2015
@SparkQA
Copy link

SparkQA commented Jun 24, 2015

Test build #35698 has finished for PR 6853 at commit af71ac7.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • s"Using output committer class $
    • logInfo(s"Using user defined output committer class $
    • s"Using output committer class $

@marmbrus
Copy link
Contributor

Thanks! Merged to master.

@asfgit asfgit closed this in b84d4b4 Jun 24, 2015
@smola smola deleted the SPARK-7088 branch June 25, 2015 07:18
@@ -121,6 +122,17 @@ trait CheckAnalysis {

case _ => // Analysis successful!
}

// Special handling for cases when self-join introduce duplicate expression ids.
case j @ Join(left, right, _, _) if left.outputSet.intersect(right.outputSet).nonEmpty =>
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not reachable according to the compiler. @smola can you submit a fix for this? thanks.

Copy link

Choose a reason for hiding this comment

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

NAVER - http://www.naver.com/

[email protected] 님께 보내신 메일 <Re: [spark] [SQL][SPARK-7088] Fix analysis for 3rd party logical plan. (#6853)> 이 다음과 같은 이유로 전송 실패했습니다.


받는 사람이 회원님의 메일을 수신차단 하였습니다.


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.

5 participants