You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/12/06 21:21:00 UTC

[jira] [Commented] (IMPALA-11758) Databases named "iceberg" confuses the parser, throws ParseException

    [ https://issues.apache.org/jira/browse/IMPALA-11758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17644033#comment-17644033 ] 

ASF subversion and git services commented on IMPALA-11758:
----------------------------------------------------------

Commit 644a6890d755bda67287fa78c64363426ff3a1e4 in impala's branch refs/heads/master from Gergely Fürnstáhl
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=644a6890d ]

IMPALA-11758: Fixed error detection for usage of reserved words.

Fixed the control flow of checking whether the parsing failed on the
usage of a reserved word where an identifier was expected. Added a hint
to the error message on how to fix the query.

Query: create database iceberg
ERROR: ParseException: Syntax error in line 1:
create database iceberg
                ^
Encountered: ICEBERG
Expected: DEFAULT, EXTENDED, FORMATTED, IF, IDENTIFIER

Hint: reserved words have to be escaped when used as an identifier, e.g. `iceberg`

CAUSED BY: Exception: Syntax error

Testing:
 - Added new tests to test_reserved_words_version.py
 - Adjusted ParserTests
 - Built docs

Change-Id: I9605d80a25ff878d12f6ca2ebb99ac26298d8efa
Reviewed-on: http://gerrit.cloudera.org:8080/19290
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Databases named "iceberg" confuses the parser, throws ParseException
> --------------------------------------------------------------------
>
>                 Key: IMPALA-11758
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11758
>             Project: IMPALA
>          Issue Type: Improvement
>            Reporter: Gergely Fürnstáhl
>            Assignee: Gergely Fürnstáhl
>            Priority: Major
>
> Impala can't create a database named "iceberg" but hive can. Valid queries fails in impala using that database.
> {code:java}
> [localhost:21050] default> create database iceberg;
> Query: create database iceberg
> ERROR: ParseException: Syntax error in line 1:
> create database iceberg
>                 ^
> Encountered: ICEBERG
> Expected: DEFAULT, EXTENDED, FORMATTED, IF, IDENTIFIER {code}
> Created database in hive.
> {code:java}
> [localhost:21050] default> use iceberg;
> Query: use iceberg
> ERROR: ParseException: Syntax error in line 1: use iceberg   
>   ^
> Encountered: ICEBERG
> Expected: DEFAULT, IDENTIFIER CAUSED BY: Exception: Syntax error
>  {code}
> Selects fails too on existing tables.
> Escaping solves the issue, e.g.:
> {code:java}
> CREATE TABLE `iceberg`.`ice_9c` (i INT, t TIMESTAMP) PARTITIONED BY (j BIGINT) STORED AS ICEBERG TBLPROPERTIES ('format-version' = '2');{code}
> Improving exception message could help the users in the future



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org