Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-497

Rearrange reserved and non-reserved keywords

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0
    • Component/s: None
    • Labels:
      None

      Description

      Keywords of Tajo are classified as reserved and non-reserved,
      and reserved keywords cannot be used as table name or column name.

      Because reserved keywords of Tajo are different from other DBs like PostgreSQL and MySQL, migrating tables from those DBs to Tajo induces table creation error sometimes.

      So, we need to rearrange reserved and non-researved keywords.

      Following shows keywords which are allowed in PostgreSQL but not allowed in Tajo.

      mydb=# \d
                List of relations
       Schema |   Name    | Type  | Owner  
      --------+-----------+-------+--------
       public | filter    | table | ktpark
       public | first     | table | ktpark
       public | format    | table | ktpark
       public | grouping  | table | ktpark
       public | hash      | table | ktpark
       public | index     | table | ktpark
       public | insert    | table | ktpark
       public | last      | table | ktpark
       public | location  | table | ktpark
       public | max       | table | ktpark
       public | min       | table | ktpark
       public | national  | table | ktpark
       public | nullif    | table | ktpark
       public | overwrite | table | ktpark
       public | precision | table | ktpark
       public | range     | table | ktpark
       public | regexp    | table | ktpark
       public | rlike     | table | ktpark
       public | set       | table | ktpark
       public | unknown   | table | ktpark
       public | var_pop   | table | ktpark
       public | var_samp  | table | ktpark
       public | varying   | table | ktpark
       public | zone      | table | ktpark
       public | bigint      | table | ktpark
       public | bit         | table | ktpark
       public | blob        | table | ktpark
       public | bool        | table | ktpark
       public | boolean     | table | ktpark
       public | bytea       | table | ktpark
       public | char        | table | ktpark
       public | date        | table | ktpark
       public | decimal     | table | ktpark
       public | double      | table | ktpark
       public | float       | table | ktpark
       public | float4      | table | ktpark
       public | float8      | table | ktpark
       public | inet4       | table | ktpark
       public | int         | table | ktpark
       public | int1        | table | ktpark
       public | int2        | table | ktpark
       public | int4        | table | ktpark
       public | int8        | table | ktpark
       public | integer     | table | ktpark
       public | nchar       | table | ktpark
       public | numeric     | table | ktpark
       public | nvarchar    | table | ktpark
       public | real        | table | ktpark
       public | smallint    | table | ktpark
       public | text        | table | ktpark
       public | time        | table | ktpark
       public | timestamp   | table | ktpark
       public | timestamptz | table | ktpark
       public | timetz      | table | ktpark
       public | tinyint     | table | ktpark
       public | varbinary   | table | ktpark
       public | varbit      | table | ktpark
       public | varchar     | table | ktpark
      

        Activity

        Hide
        sirpkt Keuntae Park added a comment -

        During the implementation, I found that even non-reserved keywords cannot be used as table or column names.
        I think it will take more time to complete this issue.

        Show
        sirpkt Keuntae Park added a comment - During the implementation, I found that even non-reserved keywords cannot be used as table or column names. I think it will take more time to complete this issue.
        Hide
        sirpkt Keuntae Park added a comment -

        I created a review request in RB https://reviews.apache.org/r/16902/

        Please review it.

        Show
        sirpkt Keuntae Park added a comment - I created a review request in RB https://reviews.apache.org/r/16902/ Please review it.
        Hide
        hyunsik Hyunsik Choi added a comment -

        +1

        I commented in RB. I appreciate you for this nice work. Please ship it!

        Show
        hyunsik Hyunsik Choi added a comment - +1 I commented in RB. I appreciate you for this nice work. Please ship it!
        Hide
        hyunsik Hyunsik Choi added a comment -

        committed it to master branch. Thanks!

        Show
        hyunsik Hyunsik Choi added a comment - committed it to master branch. Thanks!
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #41 (See https://builds.apache.org/job/Tajo-master-build/41/)
        TAJO-497: Rearrange reserved and non-reserved keywords. (sirpkt via hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=b0d81a590bb45c37f838eae93663736767040c02)

        • tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestCreateTable.java
        • tajo-core/tajo-core-backend/src/main/antlr4/org/apache/tajo/engine/parser/SQLParser.g4
        • CHANGES.txt
        • tajo-core/tajo-core-backend/src/main/antlr4/org/apache/tajo/engine/parser/SQLLexer.g4
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #41 (See https://builds.apache.org/job/Tajo-master-build/41/ ) TAJO-497 : Rearrange reserved and non-reserved keywords. (sirpkt via hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=b0d81a590bb45c37f838eae93663736767040c02 ) tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestCreateTable.java tajo-core/tajo-core-backend/src/main/antlr4/org/apache/tajo/engine/parser/SQLParser.g4 CHANGES.txt tajo-core/tajo-core-backend/src/main/antlr4/org/apache/tajo/engine/parser/SQLLexer.g4 tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java

          People

          • Assignee:
            sirpkt Keuntae Park
            Reporter:
            sirpkt Keuntae Park
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development