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

planner: unfold the wildcard when creating view #11818

Merged
merged 7 commits into from
Oct 22, 2019

Conversation

AndrewDi
Copy link
Contributor

What problem does this PR solve?

As part of View implement, remove view's wildcard and expand it.

What is changed and how it works?

ref proposal Proposal: Implement View

Check List

Tests

  • Unit test

Description

Let's take a example with create view,

CREATE VIEW V AS SELECT *FROM mysql.tidb

Before this PR,View will store select statement like

SELECT * FROM mysql.tidb

After this PR, View will store select statement like

SELECT VARIABLE_NAME,VARIABLE_VALUE,COMMENT FROM mysql.tidb

@sre-bot sre-bot added the contribution This PR is from a community contributor. label Aug 21, 2019
@AndrewDi
Copy link
Contributor Author

AndrewDi commented Aug 21, 2019

@XuHuaiyu @zz-jason PTAL

@AndrewDi AndrewDi mentioned this pull request Aug 21, 2019
19 tasks
@AndrewDi AndrewDi force-pushed the view/remove_wildcard branch 2 times, most recently from b8143de to 413210a Compare August 21, 2019 14:45
@codecov
Copy link

codecov bot commented Aug 21, 2019

Codecov Report

Merging #11818 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #11818   +/-   ##
===========================================
  Coverage   80.5501%   80.5501%           
===========================================
  Files           465        465           
  Lines        109358     109358           
===========================================
  Hits          88088      88088           
  Misses        14850      14850           
  Partials       6420       6420

@zz-jason zz-jason requested review from XuHuaiyu and zz-jason August 22, 2019 01:11
ddl/ddl_api.go Show resolved Hide resolved
planner/core/logical_plan_builder.go Outdated Show resolved Hide resolved
planner/core/planbuilder.go Show resolved Hide resolved
ddl/ddl_api.go Outdated Show resolved Hide resolved
ddl/ddl_api.go Outdated Show resolved Hide resolved
planner/core/logical_plan_builder.go Show resolved Hide resolved
@XuHuaiyu XuHuaiyu changed the title planner: remove wildcard planner: unfold the wildcard when creating view and store the unfolded sql in ViewInfo.SelectStmt Sep 2, 2019
planner/core/logical_plan_builder.go Outdated Show resolved Hide resolved
executor/show_test.go Show resolved Hide resolved
Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

LGTM

@XuHuaiyu XuHuaiyu requested a review from zz-jason September 10, 2019 02:15
ddl/ddl_api.go Outdated Show resolved Hide resolved
zz-jason
zz-jason previously approved these changes Sep 10, 2019
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. labels Sep 10, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Sep 10, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Sep 10, 2019

@AndrewDi merge failed.

@AndrewDi
Copy link
Contributor Author

/run-all-tests

@AndrewDi
Copy link
Contributor Author

@zz-jason @XuHuaiyu Please help to fix this old view test.

@XuHuaiyu
Copy link
Contributor

/run-integration-common-test tidb-test=pr/890
/run-common-test tidb-test=pr/890

@XuHuaiyu
Copy link
Contributor

@AndrewDi
Check this test case:

CREATE TABLE t1 (id INTEGER, sex CHAR(1));
CREATE VIEW v AS SELECT id, SUM(id) OVER w, sex FROM t1 WINDOW w AS (PARTITION BY sex ORDER BY id ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING);
SELECT * FROM v;

@zz-jason
Copy link
Member

@AndrewDi any update?

@AndrewDi
Copy link
Contributor Author

/run-all-tests

@AndrewDi AndrewDi force-pushed the view/remove_wildcard branch from 4a0ee36 to ffb2791 Compare September 27, 2019 02:50
@XuHuaiyu
Copy link
Contributor

/run-all-tests tidb-test=pr/925

@XuHuaiyu
Copy link
Contributor

/rebuild

1 similar comment
@zyxbest
Copy link
Contributor

zyxbest commented Oct 22, 2019

/rebuild

@zyxbest
Copy link
Contributor

zyxbest commented Oct 22, 2019

/run-all-tests

@XuHuaiyu
Copy link
Contributor

/run-all-tests tidb-test=pr/925

@XuHuaiyu
Copy link
Contributor

/run-all-tests tidb-test=pr/925

@zyxbest
Copy link
Contributor

zyxbest commented Oct 22, 2019

/run-integration-test

@zyxbest
Copy link
Contributor

zyxbest commented Oct 22, 2019

/run-sqllogic-test

@zyxbest
Copy link
Contributor

zyxbest commented Oct 22, 2019

/run-common-test

@XuHuaiyu
Copy link
Contributor

/run-integration-common-test tidb-test=pr/925
/run-common-test tidb-test=pr/925

@XuHuaiyu
Copy link
Contributor

/run-integration-common-test tidb-test=pr/925

@XuHuaiyu XuHuaiyu changed the title planner: unfold the wildcard when creating view and store the unfolded sql in ViewInfo.SelectStmt planner: unfold the wildcard when creating view Oct 22, 2019
@XuHuaiyu XuHuaiyu merged commit d15bf25 into pingcap:master Oct 22, 2019
@XuHuaiyu XuHuaiyu deleted the view/remove_wildcard branch October 22, 2019 09:55
XuHuaiyu pushed a commit to XuHuaiyu/tidb that referenced this pull request Oct 24, 2019
lfkdsk pushed a commit to JustProject/tidb that referenced this pull request Oct 24, 2019
XuHuaiyu pushed a commit to XuHuaiyu/tidb that referenced this pull request Oct 25, 2019
XiaTianliang pushed a commit to XiaTianliang/tidb that referenced this pull request Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants