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 #2333

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

Sql parse bug #2333

JING0917 opened this issue Jul 9, 2024 · 0 comments

Comments

@JING0917
Copy link

JING0917 commented Jul 9, 2024

version: 1.0.0-rc.3
SQL:SELECT * FROM ( select substring(dt,1,7) as mon, b.city_name, length(arrayDistinct(arrayFlatten(groupArray(par_user_list)))) as baoming_user_num, length(arrayDistinct(arrayFlatten(groupArray(com_user_list)))) as finish_user_num, sum(com_order_num+lose_order_num) as tot_valid_order_num, sum(complete_sesame_go_amt) as tot_cost from dws.dws_ck_silkworm_challenge a left join (select city_name, substring(toString(city_id),1,4) as city_id from dim.dim_region_code group by 1,2) b on toString(a.baoming_city_id)=b.city_id where a.dt between toString($begin_date$) and toString($end_date$) and a.challenge_id>=98 and match(a.challenge_name,'打卡') and a.challenge_id in $challenge_id$ and a.user_level in $user_level$ group by 1,2 ) AS DATART_VTABLE LIMIT 0, 1000
DB: CLICKHOUSE
EXCEPTION:org.apache.calcite.sql.parser.SqlParseException: Encountered "and match" at line 1, column 656.
Was expecting one of:
"EXCEPT" ...
"FETCH" ...
"GROUP" ...
"HAVING" ...
"INTERSECT" ...
"LIMIT" ...
"OFFSET" ...
"ORDER" ...
"MINUS" ...
"UNION" ...
"WINDOW" ...
")" ...
"." ...
"NOT" ...
"IN" ...
"<" ...
"<=" ...
">" ...
">=" ...
"=" ...
"<>" ...
"!=" ...
"BETWEEN" ...
"LIKE" ...
"SIMILAR" ...
"+" ...
"-" ...
"*" ...
"/" ...
"%" ...
"||" ...
"AND" "+" ...
"AND" "-" ...
"AND" "NOT" ...
"AND" "EXISTS" ...
"AND" "INTERVAL" ...
"AND" <UNSIGNED_INTEGER_LITERAL> ...
"AND" <DECIMAL_NUMERIC_LITERAL> ...
"AND" <APPROX_NUMERIC_LITERAL> ...
"AND" <BINARY_STRING_LITERAL> ...
"AND" <PREFIXED_STRING_LITERAL> ...
"AND" <QUOTED_STRING> ...
"AND" <UNICODE_STRING_LITERAL> ...
"AND" <BIG_QUERY_DOUBLE_QUOTED_STRING> ...
"AND" <BIG_QUERY_QUOTED_STRING> ...
"AND" "TRUE" ...
"AND" "FALSE" ...
"AND" "UNKNOWN" ...
"AND" "NULL" ...
"AND" <LBRACE_D> ...
"AND" <LBRACE_T> ...
"AND" <LBRACE_TS> ...
"AND" "DATE" ...
"AND" "TIME" ...
"AND" "TIMESTAMP" ...
"AND" "?" ...
"AND" "CAST" ...
"AND" "EXTRACT" ...
"AND" "POSITION" ...
"AND" "CONVERT" ...
"AND" "TRANSLATE" ...
"AND" "OVERLAY" ...
"AND" "FLOOR" ...
"AND" "CEIL" ...
"AND" "CEILING" ...
"AND" "SUBSTRING" ...
"AND" "TRIM" ...
"AND" "CLASSIFIER" ...
"AND" "MATCH_NUMBER" ...
"AND" "RUNNING" ...
"AND" "PREV" ...
"AND" "NEXT" ...
"AND" "JSON_EXISTS" ...
"AND" "JSON_VALUE" ...
"AND" "JSON_QUERY" ...
"AND" "JSON_OBJECT" ...
"AND" "JSON_OBJECTAGG" ...
"AND" "JSON_ARRAY" ...
"AND" "JSON_ARRAYAGG" ...
"AND" <LBRACE_FN> ...
"AND" "MULTISET" ...
"AND" "ARRAY" ...
"AND" "PERIOD" ...
"AND" "SPECIFIC" ...
"AND" ...
"AND" <HYPHENATED_IDENTIFIER> ...
"AND" <QUOTED_IDENTIFIER> ...
"AND" <BACK_QUOTED_IDENTIFIER> ...
"AND" <BRACKET_QUOTED_IDENTIFIER> ...
"AND" <UNICODE_QUOTED_IDENTIFIER> ...
"AND" "ABS" ...
"AND" "AVG" ...
"AND" "CARDINALITY" ...
"AND" "CHAR_LENGTH" ...
"AND" "CHARACTER_LENGTH" ...
"AND" "COALESCE" ...
"AND" "COLLECT" ...
"AND" "COVAR_POP" ...
"AND" "COVAR_SAMP" ...
"AND" "CUME_DIST" ...
"AND" "COUNT" ...
"AND" "CURRENT_DATE" ...
"AND" "CURRENT_TIME" ...
"AND" "CURRENT_TIMESTAMP" ...
"AND" "DENSE_RANK" ...
"AND" "ELEMENT" ...
"AND" "EVERY" ...
"AND" "EXP" ...
"AND" "FIRST_VALUE" ...
"AND" "FUSION" ...
"AND" "INTERSECTION" ...
"AND" "GROUPING" ...
"AND" "HOUR" ...
"AND" "LAG" ...
"AND" "LEAD" ...
"AND" "LEFT" ...
"AND" "LAST_VALUE" ...
"AND" "LN" ...
"AND" "LOCALTIME" ...
"AND" "LOCALTIMESTAMP" ...
"AND" "LOWER" ...
"AND" "MAX" ...
"AND" "MIN" ...
"AND" "MINUTE" ...
"AND" "MOD" ...
"AND" "MONTH" ...
"AND" "NTH_VALUE" ...
"AND" "NTILE" ...
"AND" "NULLIF" ...
"AND" "OCTET_LENGTH" ...
"AND" "PERCENT_RANK" ...
"AND" "POWER" ...
"AND" "RANK" ...
"AND" "REGR_COUNT" ...
"AND" "REGR_SXX" ...
"AND" "REGR_SYY" ...
"AND" "RIGHT" ...
"AND" "ROW_NUMBER" ...
"AND" "SECOND" ...
"AND" "SOME" ...
"AND" "SQRT" ...
"AND" "STDDEV_POP" ...
"AND" "STDDEV_SAMP" ...
"AND" "SUM" ...
"AND" "UPPER" ...
"AND" "TRUNCATE" ...
"AND" "USER" ...
"AND" "VAR_POP" ...
"AND" "VAR_SAMP" ...
"AND" "YEAR" ...
"AND" "INSERT" ...
"AND" "DAY" ...
"AND" "CURRENT_CATALOG" ...
"AND" "CURRENT_DEFAULT_TRANSFORM_GROUP" ...
"AND" "CURRENT_PATH" ...
"AND" "CURRENT_ROLE" ...
"AND" "CURRENT_SCHEMA" ...
"AND" "CURRENT_USER" ...
"AND" "SESSION_USER" ...
"AND" "SYSTEM_USER" ...
"AND" "NEW" ...
"AND" "CASE" ...
"AND" "CURRENT" ...
"AND" "CURSOR" ...
"AND" "ROW" ...
"AND" "(" ...
"[" ...
"IS" ...
"FORMAT" ...

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