Details

      Description

      Creating a table from existing table is very useful function for users. So, we should support CREATE TABLE LIKE The grammar is as follows:

      CREATE TABLE <table_name> LIKE <source_table_name>
      

      For reference, the LIKE clause specifies a table from which the new table automatically copies all column names, their data types.

      1. TAJO-699.patch
        17 kB
        Prafulla T

        Activity

        Hide
        prafulla Prafulla T added a comment -

        Is anyone working on this issue? If not, I would like to help with it.

        Show
        prafulla Prafulla T added a comment - Is anyone working on this issue? If not, I would like to help with it.
        Hide
        hyunsik Hyunsik Choi added a comment -

        I've just assigned this issue to you. Welcome to Tajo community!

        Show
        hyunsik Hyunsik Choi added a comment - I've just assigned this issue to you. Welcome to Tajo community!
        Hide
        prafulla Prafulla T added a comment - - edited

        Thanks Hyunsik.
        Patch is available for review at following link
        https://reviews.apache.org/r/21915/

        OR

        Here
        https://github.com/apache/tajo/pull/21

        Show
        prafulla Prafulla T added a comment - - edited Thanks Hyunsik. Patch is available for review at following link https://reviews.apache.org/r/21915/ OR Here https://github.com/apache/tajo/pull/21
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user prafullat opened a pull request:

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

        TAJO-699: Create a table using LIKE

        This commit implements following DDL in Tajo.
        create table <table_name> like <existing_table_name>;

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

        $ git pull https://github.com/prafullat/tajo tajo-699

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

        https://github.com/apache/tajo/pull/21.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 #21


        commit a3f0bf85641a58b0b344d0aaca1c037c608d1295
        Author: Prafulla Tekawade <prafulla_t@users.sourceforge.net>
        Date: 2014-05-26T17:24:45Z

        TAJO-699: Create a table using LIKE

        This commit implements following DDL in Tajo.
        create table <table_name> like <existing_table_name>;


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user prafullat opened a pull request: https://github.com/apache/tajo/pull/21 TAJO-699 : Create a table using LIKE This commit implements following DDL in Tajo. create table <table_name> like <existing_table_name>; You can merge this pull request into a Git repository by running: $ git pull https://github.com/prafullat/tajo tajo-699 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/21.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 #21 commit a3f0bf85641a58b0b344d0aaca1c037c608d1295 Author: Prafulla Tekawade <prafulla_t@users.sourceforge.net> Date: 2014-05-26T17:24:45Z TAJO-699 : Create a table using LIKE This commit implements following DDL in Tajo. create table <table_name> like <existing_table_name>;
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/21#issuecomment-44213036

        Thank you for contribution.

        I've just briefly reviewed your patch. The patch looks nice and includes sufficient unit tests. Actually, now I'd like to check more cases using your 'CREATE TABLE LIKE', but here is already 4:30 AM. So, I'll review your patch tomorrow, and I'll comment soon!

        Thanks!

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/21#issuecomment-44213036 Thank you for contribution. I've just briefly reviewed your patch. The patch looks nice and includes sufficient unit tests. Actually, now I'd like to check more cases using your 'CREATE TABLE LIKE', but here is already 4:30 AM. So, I'll review your patch tomorrow, and I'll comment soon! Thanks!
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12646816/TAJO-699.patch
        against master revision e2d0464.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 4 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The applied patch does not increase the total number of javadoc warnings.

        +1 checkstyle. The patch generated 0 code style errors.

        -1 findbugs. The patch appears to introduce 193 new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        -1 core tests. The patch failed these unit tests in tajo-algebra tajo-core:
        org.apache.tajo.engine.eval.TestSQLExpression

        Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/435//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/435//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-core.html
        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/435//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12646816/TAJO-699.patch against master revision e2d0464. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 4 new or modified test files. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The applied patch does not increase the total number of javadoc warnings. +1 checkstyle. The patch generated 0 code style errors. -1 findbugs. The patch appears to introduce 193 new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these unit tests in tajo-algebra tajo-core: org.apache.tajo.engine.eval.TestSQLExpression Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/435//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/435//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-core.html Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/435//console This message is automatically generated.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/21#issuecomment-44229679

        Hi Prafulla,

        I reviewed your patch in more detail. Excellent! You work is very nice. It works well. I leave only some trivial comments.

        Although we do not use maven checkstyle plugin to strictly check coding convention, we already use some coding style. Please take a look at this [1]. We use 2 space instead of tab. Other conventions you use look nice to me.

        In addition, it would be better if you use ```assertTrue(message : string, condition:boolean)``` and ```assertEquals(message : string, obj1:Object, obj2:Object)``` instead of using ```System.out.println``` in ```isClonedSchema```. It usually generates more comprehensive output messages in the tail of maven message when the test is failed.

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/21#issuecomment-44229679 Hi Prafulla, I reviewed your patch in more detail. Excellent! You work is very nice. It works well. I leave only some trivial comments. Although we do not use maven checkstyle plugin to strictly check coding convention, we already use some coding style. Please take a look at this [1] . We use 2 space instead of tab. Other conventions you use look nice to me. In addition, it would be better if you use ```assertTrue(message : string, condition:boolean)``` and ```assertEquals(message : string, obj1:Object, obj2:Object)``` instead of using ```System.out.println``` in ```isClonedSchema```. It usually generates more comprehensive output messages in the tail of maven message when the test is failed. [1] https://cwiki.apache.org/confluence/display/TAJO/Code+Style
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user prafullat commented on the pull request:

        https://github.com/apache/tajo/pull/21#issuecomment-44233163

        Thanks for comments.
        I have implemented review comments in latest commit in this pull request.
        Should I also update it on Jira?

        Show
        githubbot ASF GitHub Bot added a comment - Github user prafullat commented on the pull request: https://github.com/apache/tajo/pull/21#issuecomment-44233163 Thanks for comments. I have implemented review comments in latest commit in this pull request. Should I also update it on Jira?
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/21#issuecomment-44233976

        I think that updating github pull request is enough for us. I'll review your latest change. Thank you!

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/21#issuecomment-44233976 I think that updating github pull request is enough for us. I'll review your latest change. Thank you!
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/21#issuecomment-44316512

        +1

        The latest patch looks good to me. I'll commit it shortly. Thank you for your contribution!

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/21#issuecomment-44316512 +1 The latest patch looks good to me. I'll commit it shortly. Thank you for your contribution!
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

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

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/21
        Hide
        hyunsik Hyunsik Choi added a comment -

        committed it to master branch.

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

        FAILURE: Integrated in Tajo-master-build #226 (See https://builds.apache.org/job/Tajo-master-build/226/)
        TAJO-699: Create a table using LIKE. (Prafulla T via hyunsik) (hyunsik: rev a191b1dc7ad3189c825069084fc6fc6167a4eb87)

        • tajo-core/src/main/java/org/apache/tajo/engine/parser/HiveQLAnalyzer.java
        • CHANGES
        • tajo-core/src/test/resources/queries/default/create_table_like_1.sql
        • tajo-algebra/src/main/java/org/apache/tajo/algebra/CreateTable.java
        • tajo-core/src/test/java/org/apache/tajo/engine/query/TestCreateTable.java
        • tajo-core/src/test/java/org/apache/tajo/engine/parser/TestSQLAnalyzer.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
        • tajo-core/src/main/antlr4/org/apache/tajo/engine/parser/SQLParser.g4
        • tajo-core/src/test/java/org/apache/tajo/engine/parser/TestHiveQLAnalyzer.java
        • tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Tajo-master-build #226 (See https://builds.apache.org/job/Tajo-master-build/226/ ) TAJO-699 : Create a table using LIKE. (Prafulla T via hyunsik) (hyunsik: rev a191b1dc7ad3189c825069084fc6fc6167a4eb87) tajo-core/src/main/java/org/apache/tajo/engine/parser/HiveQLAnalyzer.java CHANGES tajo-core/src/test/resources/queries/default/create_table_like_1.sql tajo-algebra/src/main/java/org/apache/tajo/algebra/CreateTable.java tajo-core/src/test/java/org/apache/tajo/engine/query/TestCreateTable.java tajo-core/src/test/java/org/apache/tajo/engine/parser/TestSQLAnalyzer.java tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java tajo-core/src/main/antlr4/org/apache/tajo/engine/parser/SQLParser.g4 tajo-core/src/test/java/org/apache/tajo/engine/parser/TestHiveQLAnalyzer.java tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java

          People

          • Assignee:
            prafulla Prafulla T
            Reporter:
            blrunner Jaehwa Jung
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development