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

feat(planner): support subquery table reference type for new planner #5279

Merged
merged 9 commits into from
May 14, 2022

Conversation

xudong963
Copy link
Member

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

support table reference type: subquery for new planner

Changelog

  • New Feature

Related Issues

Fixes #5203

@vercel
Copy link

vercel bot commented May 10, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) May 14, 2022 at 9:17AM (UTC)

@xudong963 xudong963 marked this pull request as draft May 10, 2022 10:17
@mergify
Copy link
Contributor

mergify bot commented May 10, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label May 10, 2022
@BohuTANG BohuTANG removed their request for review May 10, 2022 10:18
@xudong963 xudong963 marked this pull request as ready for review May 13, 2022 07:30
@xudong963 xudong963 changed the title feat(planner): support table reference type: subquery for new planner feat(planner): support subquery table reference type for new planner May 13, 2022
@@ -74,9 +75,17 @@ impl<'a> Binder {
pub(super) async fn normalize_select_list(
&mut self,
select_list: &[SelectTarget<'a>],
input_context: &BindContext,
table_alias: &Option<TableAlias<'a>>,
Copy link
Member

Choose a reason for hiding this comment

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

What happen if this query:

SELECT * FROM system.columns, (SELECT 1) AS `system.columns`;

Copy link
Member Author

Choose a reason for hiding this comment

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

Duplicated table names will result in an error.

Copy link
Member

Choose a reason for hiding this comment

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

`system.table` should not be equal to system.table

https://www.db-fiddle.com/f/k2vZTW2y8Vm9AjUSTPkVGv/1

Copy link
Contributor

Choose a reason for hiding this comment

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

system.table should not be equal to system.table

https://www.db-fiddle.com/f/k2vZTW2y8Vm9AjUSTPkVGv/1

The "system.table" should be parsed into identifier. It won't be an issue.

@BohuTANG
Copy link
Member

Oops, conflicts need solved

@mergify
Copy link
Contributor

mergify bot commented May 14, 2022

This pull request has merge conflicts that must be resolved before it can be merged. @xudong963 please update it 🙏.

Try @mergify update or update manually.

@BohuTANG
Copy link
Member

Hmm, Conflicting files after another merged.

@BohuTANG BohuTANG merged commit 1d430b0 into databendlabs:main May 14, 2022
@xudong963 xudong963 deleted the table_ref branch May 14, 2022 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-review pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: support table reference type: subquery for new planner
6 participants