Druid SQL query with 'LIKE' condition for pattern matching not working

Hi,

I am using Druid 0.12.1 shipped with HDP 3.0.1. I am trying to submit one SQL query with ‘LIKE` condition to druid SQL and not able to make it working. Please let me know what am I doing wrong. I have tried using the broker as well as the router.
[hive@data1 logs]$ curl -XPOST ‘http://druid-router:8888/druid/v2/sql/’ -H’Content-Type: application/json’ -d ‘{“query”:“SELECT web_category from “druid_test.proxy_agg_druid” WHERE web_category LIKE ‘%Ist%’”}’

{“error”:“Unknown exception”,“errorMessage”:"Encountered “LIKE %” at line 1, column 75.\nWas expecting one of:\n \n “ORDER” …\n “LIMIT” …\n “OFFSET” …\n “FETCH” …\n “GROUP” …\n “HAVING” …\n “WINDOW” …\n “UNION” …\n “INTERSECT” …\n “EXCEPT” …\n “MINUS” …\n “NOT” …\n “IN” …\n “<” …\n “<=” …\n “>” …\n “>=” …\n “=” …\n “<>” …\n “!=” …\n “BETWEEN” …\n “LIKE” “+” …\n “LIKE” “-” …\n “LIKE” “NOT” …\n “LIKE” “EXISTS” …\n “LIKE” <UNSIGNED_INTEGER_LITERAL> …\n “LIKE” <DECIMAL_NUMERIC_LITERAL> …\n “LIKE” <APPROX_NUMERIC_LITERAL> …\n “LIKE” <BINARY_STRING_LITERAL> …\n “LIKE” <PREFIXED_STRING_LITERAL> …\n “LIKE” <QUOTED_STRING> …\n “LIKE” <UNICODE_STRING_LITERAL> …\n “LIKE” “TRUE” …\n “LIKE” “FALSE” …\n “LIKE” “UNKNOWN” …\n “LIKE” “NULL” …\n “LIKE” <LBRACE_D> …\n “LIKE” <LBRACE_T> …\n “LIKE” <LBRACE_TS> …\n “LIKE” “DATE” …\n “LIKE” “TIME” …\n “LIKE” “TIMESTAMP” …\n “LIKE” “INTERVAL” …\n “LIKE” “?” …\n “LIKE” “CAST” …\n “LIKE” “EXTRACT” …\n “LIKE” “POSITION” …\n “LIKE” “CONVERT” …\n “LIKE” “TRANSLATE” …\n “LIKE” “OVERLAY” …\n “LIKE” “FLOOR” …\n “LIKE” “CEIL” …\n “LIKE” “CEILING” …\n “LIKE” “SUBSTRING” …\n “LIKE” “TRIM” …\n “LIKE” “CLASSIFIER” …\n “LIKE” “MATCH_NUMBER” …\n “LIKE” “RUNNING” …\n “LIKE” “PREV” …\n “LIKE” “NEXT” …\n “LIKE” <LBRACE_FN> …\n “LIKE” “MULTISET” …\n “LIKE” “ARRAY” …\n “LIKE” “PERIOD” …\n “LIKE” “SPECIFIC” …\n “LIKE” …\n “LIKE” <QUOTED_IDENTIFIER> …\n “LIKE” <BACK_QUOTED_IDENTIFIER> …\n “LIKE” <BRACKET_QUOTED_IDENTIFIER> …\n “LIKE” <UNICODE_QUOTED_IDENTIFIER> …\n “LIKE” “ABS” …\n “LIKE” “AVG” …\n “LIKE” “CARDINALITY” …\n “LIKE” “CHAR_LENGTH” …\n “LIKE” “CHARACTER_LENGTH” …\n “LIKE” “COALESCE” …\n “LIKE” “COLLECT” …\n “LIKE” “COVAR_POP” …\n “LIKE” “COVAR_SAMP” …\n “LIKE” “CUME_DIST” …\n “LIKE” “COUNT” …\n “LIKE” “CURRENT_DATE” …\n “LIKE” “CURRENT_TIME” …\n “LIKE” “CURRENT_TIMESTAMP” …\n “LIKE” “DENSE_RANK” …\n “LIKE” “ELEMENT” …\n “LIKE” “EXP” …\n “LIKE” “FIRST_VALUE” …\n “LIKE” “FUSION” …\n “LIKE” “GROUPING” …\n “LIKE” “HOUR” …\n “LIKE” “LAG” …\n “LIKE” “LEAD” …\n “LIKE” “LAST_VALUE” …\n “LIKE” “LN” …\n “LIKE” “LOCALTIME” …\n “LIKE” “LOCALTIMESTAMP” …\n “LIKE” “LOWER” …\n “LIKE” “MAX” …\n “LIKE” “MIN” …\n “LIKE” “MINUTE” …\n “LIKE” “MOD” …\n “LIKE” “MONTH” …\n “LIKE” “NTILE” …\n “LIKE” “NULLIF” …\n “LIKE” “OCTET_LENGTH” …\n “LIKE” “PERCENT_RANK” …\n “LIKE” “POWER” …\n “LIKE” “RANK” …\n “LIKE” “REGR_SXX” …\n “LIKE” “REGR_SYY” …\n “LIKE” “ROW_NUMBER” …\n “LIKE” “SECOND” …\n “LIKE” “SQRT” …\n “LIKE” “STDDEV_POP” …\n “LIKE” “STDDEV_SAMP” …\n “LIKE” “SUM” …\n “LIKE” “UPPER” …\n “LIKE” “TRUNCATE” …\n “LIKE” “USER” …\n “LIKE” “VAR_POP” …\n “LIKE” “VAR_SAMP” …\n “LIKE” “YEAR” …\n “LIKE” “CURRENT_CATALOG” …\n “LIKE” “CURRENT_DEFAULT_TRANSFORM_GROUP” …\n “LIKE” “CURRENT_PATH” …\n “LIKE” “CURRENT_ROLE” …\n “LIKE” “CURRENT_SCHEMA” …\n “LIKE” “CURRENT_USER” …\n “LIKE” “SESSION_USER” …\n “LIKE” “SYSTEM_USER” …\n “LIKE” “NEW” …\n “LIKE” “CASE” …\n “LIKE” “CURRENT” …\n “LIKE” “CURSOR” …\n “LIKE” “ROW” …\n “LIKE” “(” …\n “+” …\n “-” …\n “*” …\n “/” …\n “%” …\n “||” …\n “AND” …\n “OR” …\n “IS” …\n “MEMBER” …\n “SUBMULTISET” …\n “CONTAINS” …\n “OVERLAPS” …\n “EQUALS” …\n “PRECEDES” …\n “SUCCEEDS” …\n “IMMEDIATELY” …\n “MULTISET” …\n “[” …\n “.” …\n “(” …\n ",“errorClass”:“org.apache.calcite.sql.parser.SqlParseException”,“host”:null}[hive@data1 logs]$

[hive@data1 logs]$ curl -XPOST ‘http://druid-router:8082/druid/v2/sql/’ -H’Content-Type: application/json’ -d ‘{“query”:“SELECT web_category from “druid_test.proxy_agg_druid” WHERE web_category LIKE ‘Ist’ LIMIT 10”}’

{“error”:“Unknown exception”,“errorMessage”:“org.apache.calcite.runtime.CalciteContextException: From line 1, column 80 to line 1, column 82: Column ‘Ist’ not found in any table”,“errorClass”:“org.apache.calcite.tools.ValidationException”,“host”:null}[hive@data1 logs]$

``

looks like you have new lines in your field? There was recent fix for this with like clause. I expect it to be in the next release.