-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[fix](scan) Incorrect scan keys lead to wrong query results. #40814
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
TPC-H: Total hot run time: 43301 ms
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 194906 ms
|
ClickBench: Total hot run time: 31.98 s
|
f189976
to
4a27742
Compare
run buildall |
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 43265 ms
|
4a27742
to
dd3b0a1
Compare
run buildall |
TPC-H: Total hot run time: 43042 ms
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 195840 ms
|
ClickBench: Total hot run time: 30.86 s
|
does 2.1 and 2.0 also have this problem? |
""" | ||
|
||
qt_select1 " select * from test_scan_keys_with_bool_type order by 1, 2, 3, 4, 5, 6, 7; " | ||
qt_select2 " select * from test_scan_keys_with_bool_type where col1 <= -100 and col2 in (true, false) and col3 = -82 order by 1, 2, 3, 4, 5, 6, 7; " |
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.
- col2 int, col2 in (1,2)
- col2 char, col2 in ('a','b')
`col7` datetime(3) REPLACE_IF_NOT_NULL NULL | ||
) ENGINE=OLAP | ||
AGGREGATE KEY(`col1`, `col2`, `col3`) | ||
DISTRIBUTED BY HASH(`col1`, `col2`, `col3`) BUCKETS 4 |
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.
set buckets to 1
disable compaction
dd3b0a1
to
e4a07ab
Compare
run buildall |
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 41695 ms
|
TPC-DS: Total hot run time: 198545 ms
|
ClickBench: Total hot run time: 33.12 s
|
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.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
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.
LGTM
…40814) ## Proposed changes ``` mysql [doris_14555]>select * from table_9436528_3; +------+------+------+------+------------------------+--------------------+------+ | col1 | col2 | col3 | col5 | col4 | col6 | col7 | +------+------+------+------+------------------------+--------------------+------+ | -100 | 1 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.904282 | NULL | | -100 | 1 | 92 | 1 | 2024-02-16 04:37:37.00 | 23423423.0324234 | NULL | | -100 | 0 | -82 | 0 | 2023-11-11 10:49:43.00 | 840968969.872149 | NULL | ``` wrong result: ``` mysql [doris_14555]>select * from table_9436528_3 where col1 <= -100 and col2 in (true, false) and col3 = -82; +------+------+------+------+------------------------+--------------------+------+ | col1 | col2 | col3 | col5 | col4 | col6 | col7 | +------+------+------+------+------------------------+--------------------+------+ | -100 | 1 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.904282 | NULL | | -100 | 1 | 92 | 1 | 2024-02-16 04:37:37.00 | 23423423.0324234 | NULL | +------+------+------+------+------------------------+--------------------+------+ ```
…40814) ``` mysql [doris_14555]>select * from table_9436528_3; +------+------+------+------+------------------------+--------------------+------+ | col1 | col2 | col3 | col5 | col4 | col6 | col7 | +------+------+------+------+------------------------+--------------------+------+ | -100 | 1 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.904282 | NULL | | -100 | 1 | 92 | 1 | 2024-02-16 04:37:37.00 | 23423423.0324234 | NULL | | -100 | 0 | -82 | 0 | 2023-11-11 10:49:43.00 | 840968969.872149 | NULL | ``` wrong result: ``` mysql [doris_14555]>select * from table_9436528_3 where col1 <= -100 and col2 in (true, false) and col3 = -82; +------+------+------+------+------------------------+--------------------+------+ | col1 | col2 | col3 | col5 | col4 | col6 | col7 | +------+------+------+------+------------------------+--------------------+------+ | -100 | 1 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.904282 | NULL | | -100 | 1 | 92 | 1 | 2024-02-16 04:37:37.00 | 23423423.0324234 | NULL | +------+------+------+------+------------------------+--------------------+------+ ```
…#40971) ## Proposed changes pick #40814 ``` mysql [doris_14555]>select * from table_9436528_3; +------+------+------+------+------------------------+--------------------+------+ | col1 | col2 | col3 | col5 | col4 | col6 | col7 | +------+------+------+------+------------------------+--------------------+------+ | -100 | 1 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.904282 | NULL | | -100 | 1 | 92 | 1 | 2024-02-16 04:37:37.00 | 23423423.0324234 | NULL | | -100 | 0 | -82 | 0 | 2023-11-11 10:49:43.00 | 840968969.872149 | NULL | ``` wrong result: ``` mysql [doris_14555]>select * from table_9436528_3 where col1 <= -100 and col2 in (true, false) and col3 = -82; +------+------+------+------+------------------------+--------------------+------+ | col1 | col2 | col3 | col5 | col4 | col6 | col7 | +------+------+------+------+------------------------+--------------------+------+ | -100 | 1 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.904282 | NULL | | -100 | 1 | 92 | 1 | 2024-02-16 04:37:37.00 | 23423423.0324234 | NULL | +------+------+------+------+------------------------+--------------------+------+ ``` ## Proposed changes Issue Number: close #xxx <!--Describe your changes.-->
## Proposed changes ``` mysql [doris_14555]>select * from table_9436528_3; +------+------+------+------+------------------------+--------------------+------+ | col1 | col2 | col3 | col5 | col4 | col6 | col7 | +------+------+------+------+------------------------+--------------------+------+ | -100 | 1 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.904282 | NULL | | -100 | 1 | 92 | 1 | 2024-02-16 04:37:37.00 | 23423423.0324234 | NULL | | -100 | 0 | -82 | 0 | 2023-11-11 10:49:43.00 | 840968969.872149 | NULL | ``` wrong result: ``` mysql [doris_14555]>select * from table_9436528_3 where col1 <= -100 and col2 in (true, false) and col3 = -82; +------+------+------+------+------------------------+--------------------+------+ | col1 | col2 | col3 | col5 | col4 | col6 | col7 | +------+------+------+------+------------------------+--------------------+------+ | -100 | 1 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.904282 | NULL | | -100 | 1 | 92 | 1 | 2024-02-16 04:37:37.00 | 23423423.0324234 | NULL | +------+------+------+------+------------------------+--------------------+------+ ```
Proposed changes
wrong result: