zy-kkk opened a new pull request, #55566:
URL: https://github.com/apache/doris/pull/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 enable_sql_converter_retry_original = 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)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to