-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Freemine.lemon.warning.as.error.with.jointest #29410
base: 3.0
Are you sure you want to change the base?
Freemine.lemon.warning.as.error.with.jointest #29410
Conversation
…exists 2. resolving joined_table syntax conflicts
source/libs/parser/inc/sql.y
Outdated
table_reference(B) INNER JOIN table_reference(E) join_on_clause_opt(F) | ||
window_offset_clause_opt(G) jlimit_clause_opt(H). { JOINED_TABLE_MK(JOIN_TYPE_INNER, JOIN_STYPE_NONE, A, B, E, F, G, H); } | ||
|
||
inner_joined(A) ::= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是outer join
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please be kindly noted, here is the old gramma:
%type join_type { EJoinType }
%destructor join_type { }
join_type(A) ::= . { A = JOIN_TYPE_INNER; }
join_type(A) ::= INNER. { A = JOIN_TYPE_INNER; }
join_type(A) ::= LEFT. { A = JOIN_TYPE_LEFT; }
join_type(A) ::= RIGHT. { A = JOIN_TYPE_RIGHT; }
join_type(A) ::= FULL. { A = JOIN_TYPE_FULL; }
%type join_subtype { EJoinSubType }
%destructor join_subtype { }
join_subtype(A) ::= . { A = JOIN_STYPE_NONE; }
join_subtype(A) ::= OUTER. { A = JOIN_STYPE_OUTER; }
join_subtype(A) ::= SEMI. { A = JOIN_STYPE_SEMI; }
join_subtype(A) ::= ANTI. { A = JOIN_STYPE_ANTI; }
join_subtype(A) ::= ASOF. { A = JOIN_STYPE_ASOF; }
join_subtype(A) ::= WINDOW. { A = JOIN_STYPE_WIN; }
which means: INNER JOIN matches:
join_type(A) ::= INNER. { A = JOIN_TYPE_INNER; }
and
join_subtye(A) ::= . { A = JOIN_STYPE_NONE; }
and i guess the actual join type is modified in c code which this PR is not touched yet.
Please reconsider if this is a MUST for this PR?
source/libs/parser/inc/sql.y
Outdated
table_reference(B) LEFT JOIN table_reference(E) join_on_clause_opt(F) | ||
window_offset_clause_opt(G) jlimit_clause_opt(H). { JOINED_TABLE_MK(JOIN_TYPE_LEFT, JOIN_STYPE_NONE, A, B, E, F, G, H); } | ||
|
||
inner_joined(A) ::= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
source/libs/parser/inc/sql.y
Outdated
table_reference(B) RIGHT JOIN table_reference(E) join_on_clause_opt(F) | ||
window_offset_clause_opt(G) jlimit_clause_opt(H). { JOINED_TABLE_MK(JOIN_TYPE_RIGHT, JOIN_STYPE_NONE, A, B, E, F, G, H); } | ||
|
||
inner_joined(A) ::= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
window_offset_clause_opt(G) jlimit_clause_opt(H). { JOINED_TABLE_MK(JOIN_TYPE_FULL, JOIN_STYPE_NONE, A, B, E, F, G, H); } | ||
|
||
/************************************************ outer join **********************************************************/ | ||
outer_joined(A) ::= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个不合法
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, according to https://docs.taosdata.com/reference/taos-sql/join/, i tend to believe FULL JOIN is illegal.
but, i tried to test with the following result:
(.py3) xxh@xxh-virtual-machine:~/Documents/taos/TDengine$ taos -s 'select * from foo.t1 full join foo.t2 on t1.ts = t2.ts'
Welcome to the TDengine Command Line Interface, Client Version:3.3.5.0.alpha
Copyright (c) 2023 by TDengine, all rights reserved.
taos> select * from foo.t1 full join foo.t2 on t1.ts = t2.ts
Query OK, 0 row(s) in set (0.004551s)
(.py3) xxh@xxh-virtual-machine:~/Documents/taos/TDengine$ git log -1
commit e5f617db796cd7110b7efe26dd24095e55128a68 (HEAD -> main, origin/main)
Merge: e102063a1e 8bf82a9ce8
Author: Shengliang Guan <slguan@taosdata.com>
Date: Fri Dec 27 14:32:11 2024 +0800
Merge pull request #29364 from taosdata/wangmm0220-patch-3
fix:log description error
so, it seems FULL JOIN is supported
by the taos version before this PR.
and once again, please confirm if we MUST do a thorough match-up in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source/libs/parser/inc/sql.y
Outdated
window_offset_clause_opt(G) jlimit_clause_opt(H). { JOINED_TABLE_MK(JOIN_TYPE_FULL, JOIN_STYPE_OUTER, A, B, E, F, G, H); } | ||
|
||
/************************************************ semi join ***********************************************************/ | ||
semi_joined(A) ::= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不合法语法可以删除
window_offset_clause_opt(G) jlimit_clause_opt(H). { JOINED_TABLE_MK(JOIN_TYPE_FULL, JOIN_STYPE_SEMI, A, B, E, F, G, H); } | ||
|
||
/************************************************ ansi join ***********************************************************/ | ||
anti_joined(A) ::= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
window_offset_clause_opt(G) jlimit_clause_opt(H). { JOINED_TABLE_MK(JOIN_TYPE_FULL, JOIN_STYPE_ANTI, A, B, E, F, G, H); } | ||
|
||
/************************************************ asof join ***********************************************************/ | ||
asof_joined(A) ::= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
window_offset_clause_opt(G) jlimit_clause_opt(H). { JOINED_TABLE_MK(JOIN_TYPE_FULL, JOIN_STYPE_ASOF, A, B, E, F, G, H); } | ||
|
||
/************************************************ window join *********************************************************/ | ||
win_joined(A) ::= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, it was initially designed to fully-compatible to what has been deployed with the old gramma, which actually seems unnecessary unless no customer strongly relied on this.
checking list to be confirmed:
|
#29277
merge with newly-added-jointest cases