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

Support case-insensitive table description command

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 0.10.1
    • Fix Version/s: 0.10.1
    • Component/s: SQL Shell
    • Labels:
      None
    • Environment:

      Tajo 0.11.0-SNAPSHOT (rev. 82d44af source checksum 8f4cffc)

      Description

      In `tsql`, 'describe table' command is case-sensitive inconsistently with other features.

      default> create table Customer(id int);
      OK
      default> select * from Customer;
      id
      -------------------------------
      (0 rows, 0.187 sec, 0 B selected)
      default> \d Customer;
      ERROR: no such a table: Customer
      

        Activity

        Hide
        hyunsik Hyunsik Choi added a comment -

        Could you try \d customer?

        Please refer to an article Database identifiers, quoting and case sensitivity (http://www.alberton.info/dbms_identifiers_and_case_sensitivity.html#.VQk07oHF_YM).

        Identifier standard of Tajo is equivalent to PostgreSQL.

        Show
        hyunsik Hyunsik Choi added a comment - Could you try \d customer ? Please refer to an article Database identifiers, quoting and case sensitivity ( http://www.alberton.info/dbms_identifiers_and_case_sensitivity.html#.VQk07oHF_YM ). Identifier standard of Tajo is equivalent to PostgreSQL.
        Hide
        dongjoon Dongjoon Hyun added a comment - - edited

        Thank you for your comment. I know. That works well. ^^; This issue is just about handling case-sensitive case in CLI side.

        Show
        dongjoon Dongjoon Hyun added a comment - - edited Thank you for your comment. I know. That works well. ^^; This issue is just about handling case-sensitive case in CLI side.
        Hide
        hyunsik Hyunsik Choi added a comment - - edited

        I'm going to show an example. It would be more comprehensive than the article I mentioned.

        default> \d
        No Relation Found
        default> create table table1 (a int);
        OK
        default> create table "Table2" (a int);
        OK
        default> \d
        Table2
        table1
        default> \d table1
        
        table name: default.table1
        table path: hdfs://localhost:8020/tajo/warehouse/default/table1
        store type: CSV
        number of rows: 0
        volume: 0 B
        Options: 
        	'text.delimiter'='|'
        
        schema: 
        a	INT4
        
        
        default> \d table2
        ERROR: no such a table: table2
        com.google.protobuf.ServiceException: java.sql.SQLException: ERROR: no such a table: table2
        
        default> \d Table2
        
        table name: default.Table2
        table path: hdfs://localhost:8020/tajo/warehouse/default/Table2
        store type: CSV
        number of rows: 0
        volume: 0 B
        Options: 
        	'text.delimiter'='|'
        
        schema: 
        a	INT4
        
        
        default> 
        
        Show
        hyunsik Hyunsik Choi added a comment - - edited I'm going to show an example. It would be more comprehensive than the article I mentioned. default > \d No Relation Found default > create table table1 (a int ); OK default > create table "Table2" (a int ); OK default > \d Table2 table1 default > \d table1 table name: default .table1 table path: hdfs: //localhost:8020/tajo/warehouse/ default /table1 store type: CSV number of rows: 0 volume: 0 B Options: 'text.delimiter'='|' schema: a INT4 default > \d table2 ERROR: no such a table: table2 com.google.protobuf.ServiceException: java.sql.SQLException: ERROR: no such a table: table2 default > \d Table2 table name: default .Table2 table path: hdfs: //localhost:8020/tajo/warehouse/ default /Table2 store type: CSV number of rows: 0 volume: 0 B Options: 'text.delimiter'='|' schema: a INT4 default >
        Hide
        hyunsik Hyunsik Choi added a comment -

        Probably, you need to scroll down the above example. It is somewhat long, but the right side scroll is not appeared.

        Show
        hyunsik Hyunsik Choi added a comment - Probably, you need to scroll down the above example. It is somewhat long, but the right side scroll is not appeared.
        Hide
        dongjoon Dongjoon Hyun added a comment -

        I see what you mean and concern now. Sorry for confusing issue description. I'm not intending to modify QUOTED identifier.

        Let me explain more. My thought is just making IDENTIFIER into LOWER(IDENTIFIER). This is the way of PostgreSQL.

        In short, every database/table identifier without quote should be handled as LOWERCASE one. And, in that context, '\d table1' equals '\d Table1' and '\d TABLE1'.

        Isn't it? Hyunsik Choi.

        Best regards,
        Dongjoon.

        Show
        dongjoon Dongjoon Hyun added a comment - I see what you mean and concern now. Sorry for confusing issue description. I'm not intending to modify QUOTED identifier. Let me explain more. My thought is just making IDENTIFIER into LOWER(IDENTIFIER). This is the way of PostgreSQL. In short, every database/table identifier without quote should be handled as LOWERCASE one. And, in that context, '\d table1' equals '\d Table1' and '\d TABLE1'. Isn't it? Hyunsik Choi . Best regards, Dongjoon.
        Hide
        hyunsik Hyunsik Choi added a comment -

        I got your point. '\d' is not SQL statement. Commands with back slash () are called meta command. So, they don't require identifier quote string. It was a design policy.

        Thanks,
        Hyunsik

        Show
        hyunsik Hyunsik Choi added a comment - I got your point. '\d' is not SQL statement. Commands with back slash () are called meta command. So, they don't require identifier quote string. It was a design policy. Thanks, Hyunsik
        Hide
        dongjoon Dongjoon Hyun added a comment -

        Oh, I see. Then, you wanted to omit Quotation marks intensionally for users' convenience. Now, I understand throughly. Could you invalidate this issue, please?

        Show
        dongjoon Dongjoon Hyun added a comment - Oh, I see. Then, you wanted to omit Quotation marks intensionally for users' convenience. Now, I understand throughly. Could you invalidate this issue, please?
        Hide
        hyunsik Hyunsik Choi added a comment -

        Sure, I'll close it as invalid. Thanks!

        Show
        hyunsik Hyunsik Choi added a comment - Sure, I'll close it as invalid. Thanks!

          People

          • Assignee:
            dongjoon Dongjoon Hyun
            Reporter:
            dongjoon Dongjoon Hyun
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development