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

[CBRD-24880] semantic check for remote table column names and aliases #4477

Merged
merged 3 commits into from
Jul 13, 2023

Conversation

beyondykk9
Copy link
Contributor

http://jira.cubrid.org/browse/CBRD-24880

It needs to check semantic for rewriting correctly the query with predicate pushing.

The dblink query can be rewritten by pushing predicates to enhance the performance. The query is rewritten by wrapping the user's query with "SELECT * FROM". While the rewriting processing it needs check the column names and aliases wether they are the same as DBLINK column definition's one.

For example, the following query is rewritten and the rewritten query returns error from the ORACLE server.

SELECT t.a, t.c FROM DBLINK(srv1, 'SELECT a, b AS p FROM t1 WHERE a > 10') t(a, c) JOIN tbl ON t.a = tbl.a WHERE c > 'a';
==> rewritten query to be executed at remote server (ORACLE or otheer DBMS)
SELECT * FROM (SELECT a, b AS p FROM t1 WHERE a > 10) cublink (a, c) WHERE c > 'a'
The query should be rewritten as below:

SELECT * FROM (SELECT a, b AS p FROM t1 WHERE a > 10) cublink WHERE p > 10

@beyondykk9 beyondykk9 merged commit 0ca4f24 into CUBRID:develop Jul 13, 2023
4 checks passed
@beyondykk9 beyondykk9 deleted the CBRD-24880 branch July 13, 2023 08:02
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.

4 participants