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

Cannot recognize the space-contained tablename and databasename

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.12.0, 0.11.1
    • Component/s: None
    • Labels:
      None

      Description

      See below.

      default> create table "table name with space" (col int);
      OK
      default> insert into "table name with space" select 1;
      OK
      default> insert into "table name with space" select 2;
      OK
      default> insert into "table name with space" select 3;
      OK
      default> select * from "table name with space";
      col
      --------------------------
      1
      2
      3
      (3 rows, 0.047 sec, 0 B selected)
      default>
      default> \d "table name with space"
      ERROR: No error message
      default>
      

      Same problem is shown in \c command.

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user dkhwangbo opened a pull request:

        https://github.com/apache/tajo/pull/860

        TAJO-1977: Cannot recognize the space-contained tablename and databasename

        I found some bugs in using ```\c``` and ```\d```. Purose of this PR is to fixing them.

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/dkhwangbo/tajo TAJO-1977

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/tajo/pull/860.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #860


        commit 2c860d549f2d479b9b9bb5c8d9ffc8947561b7f4
        Author: Dongkyu Hwangbo <hwangbodk@gmail.com>
        Date: 2015-11-16T01:40:04Z

        blank support in ConnectDatabaseCommand

        commit 74a0f6536236ce6a41becac0c7a929a0d442201a
        Author: Dongkyu Hwangbo <hwangbodk@gmail.com>
        Date: 2015-11-16T01:49:05Z

        blank support in DescTableCommand


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user dkhwangbo opened a pull request: https://github.com/apache/tajo/pull/860 TAJO-1977 : Cannot recognize the space-contained tablename and databasename I found some bugs in using ```\c``` and ```\d```. Purose of this PR is to fixing them. You can merge this pull request into a Git repository by running: $ git pull https://github.com/dkhwangbo/tajo TAJO-1977 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/860.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #860 commit 2c860d549f2d479b9b9bb5c8d9ffc8947561b7f4 Author: Dongkyu Hwangbo <hwangbodk@gmail.com> Date: 2015-11-16T01:40:04Z blank support in ConnectDatabaseCommand commit 74a0f6536236ce6a41becac0c7a929a0d442201a Author: Dongkyu Hwangbo <hwangbodk@gmail.com> Date: 2015-11-16T01:49:05Z blank support in DescTableCommand
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jihoonson commented on the pull request:

        https://github.com/apache/tajo/pull/860#issuecomment-156901742

        You need to add some tests.

        Show
        githubbot ASF GitHub Bot added a comment - Github user jihoonson commented on the pull request: https://github.com/apache/tajo/pull/860#issuecomment-156901742 You need to add some tests.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user dkhwangbo commented on the pull request:

        https://github.com/apache/tajo/pull/860#issuecomment-156904252

        May I use used unit? or create another new unit? I guess I can make some test related of this PR with used unit like TestTajoCli::testConnectDatabase and TestTajoCli::testDescTable to add some code line more in that.

        Show
        githubbot ASF GitHub Bot added a comment - Github user dkhwangbo commented on the pull request: https://github.com/apache/tajo/pull/860#issuecomment-156904252 May I use used unit? or create another new unit? I guess I can make some test related of this PR with used unit like TestTajoCli::testConnectDatabase and TestTajoCli::testDescTable to add some code line more in that.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jihoonson commented on the pull request:

        https://github.com/apache/tajo/pull/860#issuecomment-156911280

        It will be better to add a new test.

        Show
        githubbot ASF GitHub Bot added a comment - Github user jihoonson commented on the pull request: https://github.com/apache/tajo/pull/860#issuecomment-156911280 It will be better to add a new test.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user dkhwangbo commented on the pull request:

        https://github.com/apache/tajo/pull/860#issuecomment-156920057

        @jihoonson I add a new unit test. Please review this PR.

        Show
        githubbot ASF GitHub Bot added a comment - Github user dkhwangbo commented on the pull request: https://github.com/apache/tajo/pull/860#issuecomment-156920057 @jihoonson I add a new unit test. Please review this PR.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jihoonson commented on a diff in the pull request:

        https://github.com/apache/tajo/pull/860#discussion_r44930822

        — Diff: tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java —
        @@ -228,17 +237,26 @@ private void verifyDescTable(String sql, String tableName, String resultFileName
        }
        }

        • @Test
        • public void testDescTable() throws Exception {
          + public void testDescTable(String testTableName, String resultFileName) throws Exception {
          String tableName;
          if (cluster.isHiveCatalogStoreRunning()) { - tableName = "TEST_DESC_TABLE".toLowerCase(); + tableName = testTableName.toLowerCase(); }

          else

          { - tableName = "TEST_DESC_TABLE"; + tableName = testTableName; }

        String sql = "create table \"" + tableName + "\" (col1 int4, col2 int4);";

        • verifyDescTable(sql, tableName, "testDescTable.result");
            • End diff –

        If this file does not used anymore, please remove it.

        Show
        githubbot ASF GitHub Bot added a comment - Github user jihoonson commented on a diff in the pull request: https://github.com/apache/tajo/pull/860#discussion_r44930822 — Diff: tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java — @@ -228,17 +237,26 @@ private void verifyDescTable(String sql, String tableName, String resultFileName } } @Test public void testDescTable() throws Exception { + public void testDescTable(String testTableName, String resultFileName) throws Exception { String tableName; if (cluster.isHiveCatalogStoreRunning()) { - tableName = "TEST_DESC_TABLE".toLowerCase(); + tableName = testTableName.toLowerCase(); } else { - tableName = "TEST_DESC_TABLE"; + tableName = testTableName; } String sql = "create table \"" + tableName + "\" (col1 int4, col2 int4);"; verifyDescTable(sql, tableName, "testDescTable.result"); End diff – If this file does not used anymore, please remove it.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user dkhwangbo commented on the pull request:

        https://github.com/apache/tajo/pull/860#issuecomment-157235243

        @jihoonson Thanks for your review. I remove ```testDescTable.result``` via ```git rm``` .

        Show
        githubbot ASF GitHub Bot added a comment - Github user dkhwangbo commented on the pull request: https://github.com/apache/tajo/pull/860#issuecomment-157235243 @jihoonson Thanks for your review. I remove ```testDescTable.result``` via ```git rm``` .
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jihoonson commented on the pull request:

        https://github.com/apache/tajo/pull/860#issuecomment-157245994

        +1 LGTM.

        Show
        githubbot ASF GitHub Bot added a comment - Github user jihoonson commented on the pull request: https://github.com/apache/tajo/pull/860#issuecomment-157245994 +1 LGTM.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/tajo/pull/860

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/860
        Hide
        jihoonson Jihoon Son added a comment -

        Committed to master and 0.11.1

        Show
        jihoonson Jihoon Son added a comment - Committed to master and 0.11.1
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Tajo-master-CODEGEN-build #593 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/593/)
        TAJO-1977: Cannot recognize the space-contained tablename and (jihoonson: rev 10159c7f84a203194e7124a5cbbcbcc6ce2f9b95)

        • tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable.result
        • tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/DescTableCommand.java
        • CHANGES
        • tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/ConnectDatabaseCommand.java
        • tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable1.result
        • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java
        • tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable2.result
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Tajo-master-CODEGEN-build #593 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/593/ ) TAJO-1977 : Cannot recognize the space-contained tablename and (jihoonson: rev 10159c7f84a203194e7124a5cbbcbcc6ce2f9b95) tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable.result tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/DescTableCommand.java CHANGES tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/ConnectDatabaseCommand.java tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable1.result tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable2.result
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #976 (See https://builds.apache.org/job/Tajo-master-build/976/)
        TAJO-1977: Cannot recognize the space-contained tablename and (jihoonson: rev 10159c7f84a203194e7124a5cbbcbcc6ce2f9b95)

        • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java
        • tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable2.result
        • tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/DescTableCommand.java
        • tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/ConnectDatabaseCommand.java
        • CHANGES
        • tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable.result
        • tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable1.result
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #976 (See https://builds.apache.org/job/Tajo-master-build/976/ ) TAJO-1977 : Cannot recognize the space-contained tablename and (jihoonson: rev 10159c7f84a203194e7124a5cbbcbcc6ce2f9b95) tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable2.result tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/DescTableCommand.java tajo-cli/src/main/java/org/apache/tajo/cli/tsql/commands/ConnectDatabaseCommand.java CHANGES tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable.result tajo-core-tests/src/test/resources/results/TestTajoCli/testDescTable1.result

          People

          • Assignee:
            dkhwangbo Dongkyu Hwangbo
            Reporter:
            dkhwangbo Dongkyu Hwangbo
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development