-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fix MaterializedView select with CTE bug #5165
Conversation
@@ -86,7 +86,7 @@ | |||
|
|||
private final PlannerContext ctx_; | |||
private final ArrayList<ScanNode> scanNodes = Lists.newArrayList(); | |||
private Map<UUID, List<ScanNode>> selectStmtToScanNodes = Maps.newHashMap(); | |||
private Map<Analyzer, List<ScanNode>> selectStmtToScanNodes = Maps.newHashMap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the Analyzer of CTE same as outer query?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
For SQL
select id, t1 from(
select id, a as t1 from t
union all
select id, aaa as t1 from t
) k2;
The analyzer instances for select id, a as t1 from t
and select id, aaa as t1 from t
are different.
Such as, The analyzer instances for select id, a as t1 from t
is 6177, which ancestors are[6219,6220,6221],
The analyzer instances for select id, aaa as t1 from t
is 6225, which ancestors are[6247,6220,6221].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi, @kangkaisen , there are unused imports:
Please fix it first. |
@morningman done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Change-Id: I48d6e57ec0beb91606a464f9eb4c45aadec1fc27
Fix #5164
For different Analyzer scopes, the id for SelectStmt maybe the same, but the Analyzer instance always unique