Skip to content

[CALCITE-3449] Sync tableName logic from TableScan into TableModify #1541

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

Closed
wants to merge 2 commits into from

Conversation

pinkdawn
Copy link

Jira issue: Jira CALCITE-3449

Fix the bug, modify sql(insert/update/delete) will wrongly have sub-schema before the tablename.

sqlTargetTable = new SqlIdentifier(qualifiedName, SqlParserPos.ZERO);
}

return sqlTargetTable;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, the code looks good, can you add a test case in RelToSqlConverterTest ?

/** @see #dispatch */
public Result visit(TableModify modify) {
final Map<String, RelDataType> pairs = ImmutableMap.of();
final Context context = aliasContext(pairs, false);

// Target Table Name
final SqlIdentifier sqlTargetTable =
new SqlIdentifier(modify.getTable().getQualifiedName(), POS);
final SqlIdentifier sqlTargetTable = getSqlTargetTable(modify);
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for this fix ~

@danny0405 danny0405 changed the title [CALCITE-3449] sync tableName logic from TableScan into TableModify [CALCITE-3449] Sync tableName logic from TableScan into TableModify Oct 30, 2019
@danny0405 danny0405 added no-tests-is-ok No tests is also acceptable, because the fix is straightforward LGTM-will-merge-soon Overall PR looks OK. Only minor things left. labels Oct 30, 2019
@danny0405 danny0405 closed this in e12d055 Nov 1, 2019
danny0405 pushed a commit that referenced this pull request Nov 1, 2019
…eModify (dy.Zhuang)

When sending queries to target databse, sub schemas should be removed
from the sql.

close #1541
XuQianJin-Stars pushed a commit to XuQianJin-Stars/calcite that referenced this pull request Nov 17, 2019
…eModify (dy.Zhuang)

When sending queries to target databse, sub schemas should be removed
from the sql.

close apache#1541
XuQianJin-Stars pushed a commit to XuQianJin-Stars/calcite that referenced this pull request Nov 20, 2019
…eModify (dy.Zhuang)

When sending queries to target databse, sub schemas should be removed
from the sql.

close apache#1541
XuQianJin-Stars pushed a commit to XuQianJin-Stars/calcite that referenced this pull request Nov 20, 2019
…eModify (dy.Zhuang)

When sending queries to target databse, sub schemas should be removed
from the sql.

close apache#1541
wangxlong pushed a commit to wangxlong/calcite that referenced this pull request Feb 13, 2020
…eModify (dy.Zhuang)

When sending queries to target databse, sub schemas should be removed
from the sql.

close apache#1541
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LGTM-will-merge-soon Overall PR looks OK. Only minor things left. no-tests-is-ok No tests is also acceptable, because the fix is straightforward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants