branch-3.1: [Enhancement](sql-dialect) Support retrying original sql after error#57498
Merged
morningman merged 2 commits intoapache:branch-3.1from Oct 31, 2025
Merged
branch-3.1: [Enhancement](sql-dialect) Support retrying original sql after error#57498morningman merged 2 commits intoapache:branch-3.1from
morningman merged 2 commits intoapache:branch-3.1from
Conversation
…pache#55566) Add a retry logic. When using SqlConverter for dialect conversion, in some cases we use the doris dialect instead of others, but these SQLs will also be converted once by SqlConverter, which may cause errors. Therefore, you can use the enable_sql_converter_retry_original variable to control whether to use the original SQL to retry the parser. ```sql Doris > set sql_dialect = 'hive'; Query OK, 0 rows affected (0.03 sec) Doris > SELECT DATE( DATE_SUB( requirement_created_date, INTERVAL DAYOFWEEK (requirement_created_date) - 1 DAY ) ) AS requirement_created_date, COUNT(distinct tapd_id) AS count FROM test.test_tapd_data GROUP BY DATE( DATE_SUB( requirement_created_date, INTERVAL DAYOFWEEK (requirement_created_date) - 1 DAY ) ) LIMIT 10000; ERROR 1105 (HY000): errCode = 2, detailMessage = Only supported: +(line 1, pos 61) == SQL == SELECT DATE(DATE_ADD(CAST(requirement_created_date AS DATE), (INTERVAL (DAYOFWEEK(requirement_created_date) - 1) DAY) * -1)) AS requirement_created_date, COUNT(DISTINCT tapd_id) AS `count` FROM test.test_tapd_data AS test_tapd_data GROUP BY DATE(DATE_ADD(CAST(requirement_created_date AS DATE), (INTERVAL (DAYOFWEEK(requirement_created_date) - 1) DAY) * -1)) LIMIT 10000; -------------------------------------------------------------^^^ Doris > set retry_origin_sql_on_convert_fail = true; Query OK, 0 rows affected (0.02 sec) Doris > SELECT DATE( DATE_SUB( requirement_created_date, INTERVAL DAYOFWEEK (requirement_created_date) - 1 DAY ) ) AS requirement_created_date, COUNT(distinct tapd_id) AS count FROM test.test_tapd_data GROUP BY DATE( DATE_SUB( requirement_created_date, INTERVAL DAYOFWEEK (requirement_created_date) - 1 DAY ) ) LIMIT 10000; Empty set (0.07 sec) ```
Member
Author
|
run buildall |
Member
Author
|
run buildall |
morrySnow
approved these changes
Oct 31, 2025
Closed
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.
pick (#55566)