Repository navigation
Fix Q28 for selectdb - #47
Merged
Merged
Conversation
alexey-milovidov
approved these changes
Nov 2, 2022
JelteF
added a commit
to JelteF/ClickBench
that referenced
this pull request
Nov 15, 2024
Q28 contains backslashes, specifically the backslash in `\1` is very important for the meaning of the query. However, both backslashes in this query are accidentally removed in almost all benchmark scripts because they used `read` instead of `read -r`. This adds the `-r` flag to all the scripts that didn't have it yet, to make sure that `read` interprets it as a raw `\` character instead of an escape sequence. With this change the REGEXP_REPLACE call doesn't always return the literal string "1", but actually (as intended by the query) the referrer domain. This change generally makes the query significantly slower to execute, because now there are many more groups. I'm not sure how this should be listed in the results UI. It might make sense to ignore the query or something. This problem was found independently in ClickHouse#47 and ClickHouse#72, but fixed in a different way. I'm not sure if the fix that was made for starrocks in ClickHouse#72 is actually correct though, because it seems to fix the issue twice: It replaces `\1` with `\\1`, but it also added the `-r` flag to `read`. Apart from those issues there were already a few benchmarks that were using the `-r` flag: ``` ❯ rg 'while read -r' elasticsearch/run.sh 5:cat 'queries.sql' | while read -r QUERY; do starrocks/run.sh 8:cat queries.sql | while read -r query; do doris/run.sh 8:while read -r query; do crunchy-bridge-for-analytics/run.sh 22: while read -r query; do ```
JelteF
added a commit
to JelteF/ClickBench
that referenced
this pull request
Nov 15, 2024
Q28 contains backslashes, specifically the backslash in `\1` is very important for the meaning of the query. However, both backslashes in this query are accidentally removed in almost all benchmark scripts because they used `read` instead of `read -r`. This adds the `-r` flag to all the scripts that didn't have it yet, to make sure that `read` interprets it as a raw `\` character instead of an escape sequence. With this change the REGEXP_REPLACE call doesn't always return the literal string "1", but actually (as intended by the query) the referrer domain. This change generally makes the query significantly slower to execute, because now there are many more groups. I'm not sure how this should be listed in the results UI. It might make sense to ignore the query or something. This problem was found independently in ClickHouse#47 and ClickHouse#72, but fixed in a different way. I'm not sure if the fix that was made for starrocks in ClickHouse#72 is actually correct though, because it seems to fix the issue twice: It replaces `\1` with `\\1`, but it also added the `-r` flag to `read`. Apart from those issues there were already a few benchmarks that were using the `-r` flag: ``` ❯ rg 'while read -r' elasticsearch/run.sh 5:cat 'queries.sql' | while read -r QUERY; do starrocks/run.sh 8:cat queries.sql | while read -r query; do doris/run.sh 8:while read -r query; do crunchy-bridge-for-analytics/run.sh 22: while read -r query; do ```
JelteF
added a commit
to JelteF/ClickBench
that referenced
this pull request
Nov 15, 2024
Q28 contains backslashes, specifically the backslash in `\1` is very important for the meaning of the query. However, both backslashes in this query are accidentally removed in almost all benchmark scripts because they used `read` instead of `read -r`. This adds the `-r` flag to all the scripts that didn't have it yet, to make sure that `read` interprets it as a raw `\` character instead of an escape sequence. With this change the REGEXP_REPLACE call doesn't always return the literal string "1", but actually (as intended by the query) the referrer domain. This change generally makes the query significantly slower to execute, because now there are many more groups. I'm not sure how this should be listed in the results UI. It might make sense to ignore the query or something. This problem was found independently in ClickHouse#47 and ClickHouse#72, but fixed in a different way. I'm not sure if the fix that was made for starrocks in ClickHouse#72 is actually correct though, because it seems to fix the issue twice: It replaces `\1` with `\\1`, but it also added the `-r` flag to `read`. Apart from those issues there were already a few benchmarks that were using the `-r` flag: ``` ❯ rg 'while read -r' elasticsearch/run.sh 5:cat 'queries.sql' | while read -r QUERY; do starrocks/run.sh 8:cat queries.sql | while read -r query; do doris/run.sh 8:while read -r query; do crunchy-bridge-for-analytics/run.sh 22: while read -r query; do ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
\in back reference should be escaped: