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_v2): support standalone VALUES clause #726

Merged
merged 13 commits into from
Nov 7, 2022

Conversation

wangrunji0408
Copy link
Member

@wangrunji0408 wangrunji0408 commented Nov 7, 2022

This PR adds support for standalone VALUES clause (without INSERT).

> \v2
switched to planner v2
in 0.000s
> values (1, 'gg'), (0.1, true);
+-----+------+
| 1   | gg   |
| 0.1 | true |
+-----+------+

Previously the VALUES clause must be used within an INSERT statement, so we can infer the output types of the VALUES plan. But this will no longer work for a standalone VALUES. To solve this problem, we extend type analysis to plan nodes and introduce the STRUCT(..) type to describe the output types for plans. We also define the union of 2 types, which is their minimum compatible type. Then the type of a VALUES plan can be inferred as the union of all types of its rows.

This PR also fixes some bugs in the new binder, and completes EXPLAIN for all plans.

Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
This almost reverts commit aaf720d.

Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
@wangrunji0408 wangrunji0408 requested a review from skyzh November 7, 2022 05:07
Signed-off-by: Runji Wang <wangrunji0408@163.com>
@wangrunji0408 wangrunji0408 merged commit 19b4cab into main Nov 7, 2022
@wangrunji0408 wangrunji0408 deleted the wrj/fix-binder-v2 branch November 7, 2022 23:54
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.

2 participants