Skip to content
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

Sql parse bug #2332

Open
JING0917 opened this issue Jul 2, 2024 · 0 comments
Open

Sql parse bug #2332

JING0917 opened this issue Jul 2, 2024 · 0 comments

Comments

@JING0917
Copy link

JING0917 commented Jul 2, 2024

version: 1.0.0-rc.3
SQL:SELECT * FROM ( select begin_date, end_date, store_id, store_name, store_banner_list, merchant_id, case when meituan_rebate_amt>0 and eleme_rebate_amt>0 then '美团|饿了么' when meituan_rebate_amt>0 and eleme_rebate_amt=0 then '美团' when meituan_rebate_amt<=0 and eleme_rebate_amt>0 then '饿了么' END AS store_platform, CASE WHEN promotion_rebate_type = 0 AND meituan_rebate_amt > 0 THEN concat('满', toString(meituan_order_amt), '返', toString(meituan_user_rebate_point/100)) WHEN promotion_rebate_type = 1 AND meituan_rebate_amt > 0 THEN concat('最高返', toString(meituan_user_rebate_point/100)) WHEN promotion_rebate_type = 0 AND eleme_rebate_amt > 0 THEN concat('满', toString(eleme_order_amt), '返', toString(eleme_user_rebate_point/100)) WHEN promotion_rebate_type = 1 AND eleme_rebate_amt > 0 THEN concat('最高返', toString(eleme_user_rebate_point/100)) END AS meal_label, CASE WHEN match(rebate_condition_desc,'用餐反馈') THEN '用餐反馈' ELSE '无需反馈' END AS rebate_condition_desc, concat(toString(daily_begin_hour),':00','-',toString(daily_end_hour),':00') as time_duration, county_id, bd_id, sum(meituan_promotion_quota+eleme_promotion_quota) as promotion_quota from dwd.dwd_ck_silkworm_store_promotion_merge_h where toDate(create_time)<>toDate(end_date) and toDate(begin_date)>=$begin_date$ and toDate(end_date)<=$end_date$ and store_id=309173 group by 1,2,3,4,5,6,7,8,9,10,11,12 ) AS DATART_VTABLE LIMIT 0, 1000
DB: CLICKHOUSE
EXCEPTION:org.apache.calcite.sql.parser.SqlParseException: Encountered "match" at line 1, column 1046.
Was expecting one of:
"CURSOR" ...
"EXISTS" ...
"NOT" ...
"ROW" ...
"(" ...
"+" ...
"-" ...
"INTERVAL" ...
<UNSIGNED_INTEGER_LITERAL> ...
<DECIMAL_NUMERIC_LITERAL> ...
<APPROX_NUMERIC_LITERAL> ...
<BINARY_STRING_LITERAL> ...
<PREFIXED_STRING_LITERAL> ...
<QUOTED_STRING> ...
<UNICODE_STRING_LITERAL> ...
<BIG_QUERY_DOUBLE_QUOTED_STRING> ...
<BIG_QUERY_QUOTED_STRING> ...
"TRUE" ...
"FALSE" ...
"UNKNOWN" ...
"NULL" ...
<LBRACE_D> ...
<LBRACE_T> ...
<LBRACE_TS> ...
"DATE" ...
"TIME" ...
"TIMESTAMP" ...
"?" ...
"CAST" ...
"EXTRACT" ...
"POSITION" ...
"CONVERT" ...
"TRANSLATE" ...
"OVERLAY" ...
"FLOOR" ...
"CEIL" ...
"CEILING" ...
"SUBSTRING" ...
"TRIM" ...
"CLASSIFIER" ...
"MATCH_NUMBER" ...
"RUNNING" ...
"PREV" ...
"NEXT" ...
"JSON_EXISTS" ...
"JSON_VALUE" ...
"JSON_QUERY" ...
"JSON_OBJECT" ...
"JSON_OBJECTAGG" ...
"JSON_ARRAY" ...
"JSON_ARRAYAGG" ...
<LBRACE_FN> ...
"MULTISET" ...
"ARRAY" ...
"PERIOD" ...
"SPECIFIC" ...
...
<HYPHENATED_IDENTIFIER> ...
<QUOTED_IDENTIFIER> ...
<BACK_QUOTED_IDENTIFIER> ...
<BRACKET_QUOTED_IDENTIFIER> ...
<UNICODE_QUOTED_IDENTIFIER> ...
"ABS" ...
"AVG" ...
"CARDINALITY" ...
"CHAR_LENGTH" ...
"CHARACTER_LENGTH" ...
"COALESCE" ...
"COLLECT" ...
"COVAR_POP" ...
"COVAR_SAMP" ...
"CUME_DIST" ...
"COUNT" ...
"CURRENT_DATE" ...
"CURRENT_TIME" ...
"CURRENT_TIMESTAMP" ...
"DENSE_RANK" ...
"ELEMENT" ...
"EVERY" ...
"EXP" ...
"FIRST_VALUE" ...
"FUSION" ...
"INTERSECTION" ...
"GROUPING" ...
"HOUR" ...
"LAG" ...
"LEAD" ...
"LEFT" ...
"LAST_VALUE" ...
"LN" ...
"LOCALTIME" ...
"LOCALTIMESTAMP" ...
"LOWER" ...
"MAX" ...
"MIN" ...
"MINUTE" ...
"MOD" ...
"MONTH" ...
"NTH_VALUE" ...
"NTILE" ...
"NULLIF" ...
"OCTET_LENGTH" ...
"PERCENT_RANK" ...
"POWER" ...
"RANK" ...
"REGR_COUNT" ...
"REGR_SXX" ...
"REGR_SYY" ...
"RIGHT" ...
"ROW_NUMBER" ...
"SECOND" ...
"SOME" ...
"SQRT" ...
"STDDEV_POP" ...
"STDDEV_SAMP" ...
"SUM" ...
"UPPER" ...
"TRUNCATE" ...
"USER" ...
"VAR_POP" ...
"VAR_SAMP" ...
"YEAR" ...
"INSERT" ...
"DAY" ...
"CURRENT_CATALOG" ...
"CURRENT_DEFAULT_TRANSFORM_GROUP" ...
"CURRENT_PATH" ...
"CURRENT_ROLE" ...
"CURRENT_SCHEMA" ...
"CURRENT_USER" ...
"SESSION_USER" ...
"SYSTEM_USER" ...
"NEW" ...
"CASE" ...
"CURRENT" ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant