mirror of
https://github.com/apache/impala.git
synced 2025-12-25 11:04:13 -05:00
This patch trims trailing comments while parsing queries in non-interactive mode. Users usually have comments in the end of the script which should be ignored. Without this patch, the script fails with an exception since it expects a valid SQL. The behavior however remains the same with interactive mode. Change-Id: I723763ef7eedd03cf22058fadf06e9673a0d94d2 Reviewed-on: http://gerrit.cloudera.org:8080/3169 Reviewed-by: Casey Ching <casey@cloudera.com> Tested-by: Internal Jenkins
20 lines
347 B
SQL
20 lines
347 B
SQL
-- foobar
|
|
/*this is a comment*/
|
|
SELECT 1+1 -- This comment continues to the end of line
|
|
;
|
|
SELECT 1 /* this is an in-line comment */ + 1;
|
|
SELECT 1+
|
|
/*
|
|
this is a
|
|
multiple-line comment
|
|
*/
|
|
1;
|
|
SELECT /* This comment block
|
|
is OK */ 2;
|
|
/* Trailing comment -1 */
|
|
-- Trailing comment -2
|
|
/*
|
|
-- query inside a comment
|
|
select 2;
|
|
/* nested comments end */
|