Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: Planner/Optimizer
    • Labels:
      None

      Description

      INSERT INTO statement support target fields. For example, you can specify target column as follows:

      INSERT INTO t1 (c1, c3) SELECT x, y FROM t2
      

      But, the current INSERT INTO statement does not support nested fields as target columns. We should support it.

        Issue Links

          Activity

          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Tajo-master-build #790 (See https://builds.apache.org/job/Tajo-master-build/790/)
          TAJO-1723: INSERT INTO statement should allow nested fields as target columns. (hyunsik: rev a94936ae569983bb89b4a5270d0203d7b5e591c2)

          • tajo-core/src/test/resources/queries/TestSelectNestedRecord/testSelect0.sql
          • tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java
          • tajo-core/src/test/resources/queries/TestSelectNestedRecord/sample0_ddl.sql
          • tajo-core/src/test/resources/results/TestSelectNestedRecord/testSelect0.result
          • tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/NestedPathUtil.java
          • tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/json/JsonLineSerializer.java
          • CHANGES
          • tajo-algebra/src/main/java/org/apache/tajo/algebra/Insert.java
          • tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectNestedRecord.java
          • tajo-plan/src/main/java/org/apache/tajo/plan/LogicalPlanner.java
          • tajo-core/src/main/antlr4/org/apache/tajo/engine/parser/SQLParser.g4
          • tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/SchemaUtil.java
          • tajo-core/src/test/resources/results/TestSelectNestedRecord/testInsertType2.result
          • tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/json/JsonLineDeserializer.java
          • tajo-core/src/test/resources/results/TestSelectNestedRecord/testInsertType1.result
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Tajo-master-build #790 (See https://builds.apache.org/job/Tajo-master-build/790/ ) TAJO-1723 : INSERT INTO statement should allow nested fields as target columns. (hyunsik: rev a94936ae569983bb89b4a5270d0203d7b5e591c2) tajo-core/src/test/resources/queries/TestSelectNestedRecord/testSelect0.sql tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java tajo-core/src/test/resources/queries/TestSelectNestedRecord/sample0_ddl.sql tajo-core/src/test/resources/results/TestSelectNestedRecord/testSelect0.result tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/NestedPathUtil.java tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/json/JsonLineSerializer.java CHANGES tajo-algebra/src/main/java/org/apache/tajo/algebra/Insert.java tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectNestedRecord.java tajo-plan/src/main/java/org/apache/tajo/plan/LogicalPlanner.java tajo-core/src/main/antlr4/org/apache/tajo/engine/parser/SQLParser.g4 tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/SchemaUtil.java tajo-core/src/test/resources/results/TestSelectNestedRecord/testInsertType2.result tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/json/JsonLineDeserializer.java tajo-core/src/test/resources/results/TestSelectNestedRecord/testInsertType1.result
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Tajo-master-CODEGEN-build #428 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/428/)
          TAJO-1723: INSERT INTO statement should allow nested fields as target columns. (hyunsik: rev a94936ae569983bb89b4a5270d0203d7b5e591c2)

          • tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectNestedRecord.java
          • tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/json/JsonLineDeserializer.java
          • tajo-core/src/main/antlr4/org/apache/tajo/engine/parser/SQLParser.g4
          • tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/NestedPathUtil.java
          • tajo-core/src/test/resources/queries/TestSelectNestedRecord/sample0_ddl.sql
          • tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java
          • tajo-plan/src/main/java/org/apache/tajo/plan/LogicalPlanner.java
          • tajo-core/src/test/resources/results/TestSelectNestedRecord/testSelect0.result
          • tajo-core/src/test/resources/queries/TestSelectNestedRecord/testSelect0.sql
          • tajo-core/src/test/resources/results/TestSelectNestedRecord/testInsertType1.result
          • tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/SchemaUtil.java
          • CHANGES
          • tajo-algebra/src/main/java/org/apache/tajo/algebra/Insert.java
          • tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/json/JsonLineSerializer.java
          • tajo-core/src/test/resources/results/TestSelectNestedRecord/testInsertType2.result
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Tajo-master-CODEGEN-build #428 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/428/ ) TAJO-1723 : INSERT INTO statement should allow nested fields as target columns. (hyunsik: rev a94936ae569983bb89b4a5270d0203d7b5e591c2) tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectNestedRecord.java tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/json/JsonLineDeserializer.java tajo-core/src/main/antlr4/org/apache/tajo/engine/parser/SQLParser.g4 tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/NestedPathUtil.java tajo-core/src/test/resources/queries/TestSelectNestedRecord/sample0_ddl.sql tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java tajo-plan/src/main/java/org/apache/tajo/plan/LogicalPlanner.java tajo-core/src/test/resources/results/TestSelectNestedRecord/testSelect0.result tajo-core/src/test/resources/queries/TestSelectNestedRecord/testSelect0.sql tajo-core/src/test/resources/results/TestSelectNestedRecord/testInsertType1.result tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/SchemaUtil.java CHANGES tajo-algebra/src/main/java/org/apache/tajo/algebra/Insert.java tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/json/JsonLineSerializer.java tajo-core/src/test/resources/results/TestSelectNestedRecord/testInsertType2.result
          Hide
          hyunsik Hyunsik Choi added a comment -

          committed.

          Show
          hyunsik Hyunsik Choi added a comment - committed.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

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

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

          Github user jinossy commented on the pull request:

          https://github.com/apache/tajo/pull/668#issuecomment-127497646

          +1 Looks great to me

          Show
          githubbot ASF GitHub Bot added a comment - Github user jinossy commented on the pull request: https://github.com/apache/tajo/pull/668#issuecomment-127497646 +1 Looks great to me
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on the pull request:

          https://github.com/apache/tajo/pull/668#issuecomment-126306890

          TestSelectNestedRecord contains some insertion tests. Its purpose is not matched to the class name. I wanted to merge all unit tests related to nested fields into one test. Later, I'll move them into more proper one.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/668#issuecomment-126306890 TestSelectNestedRecord contains some insertion tests. Its purpose is not matched to the class name. I wanted to merge all unit tests related to nested fields into one test. Later, I'll move them into more proper one.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user hyunsik opened a pull request:

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

          TAJO-1723: INSERT INTO statement should allow nested fields as target columns.

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

          $ git pull https://github.com/hyunsik/tajo TAJO-1723

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

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


          commit 5faaeccdf3e1ccffa445107ac65ed6a0cef11f54
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2015-07-30T11:00:12Z

          initial work

          • Improve SQL parser to recognize nested target fields in INSERT INTO statement.
          • Add workaround for hanging TaskContainer.
          • Improve logical planner to recognize nested target fields in INSERT INTO statement.

          commit ef499b3dffa846d31462c5a4be9042d83eec9ed1
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2015-07-30T12:21:33Z

          TAJO-1723: INSERT INTO statement should allow nested fields as target columns.

          commit 334db6d0cf471fd1f00a41ee44133ac70d1153e6
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2015-07-30T12:23:43Z

          Refine changes.

          commit e9acd683a1e075c20bc78ca26058a84b1305b078
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2015-07-30T12:24:57Z

          Moved some methods to SchemaUtil.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user hyunsik opened a pull request: https://github.com/apache/tajo/pull/668 TAJO-1723 : INSERT INTO statement should allow nested fields as target columns. You can merge this pull request into a Git repository by running: $ git pull https://github.com/hyunsik/tajo TAJO-1723 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/668.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 #668 commit 5faaeccdf3e1ccffa445107ac65ed6a0cef11f54 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-07-30T11:00:12Z initial work Improve SQL parser to recognize nested target fields in INSERT INTO statement. Add workaround for hanging TaskContainer. Improve logical planner to recognize nested target fields in INSERT INTO statement. commit ef499b3dffa846d31462c5a4be9042d83eec9ed1 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-07-30T12:21:33Z TAJO-1723 : INSERT INTO statement should allow nested fields as target columns. commit 334db6d0cf471fd1f00a41ee44133ac70d1153e6 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-07-30T12:23:43Z Refine changes. commit e9acd683a1e075c20bc78ca26058a84b1305b078 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-07-30T12:24:57Z Moved some methods to SchemaUtil.

            People

            • Assignee:
              hyunsik Hyunsik Choi
              Reporter:
              hyunsik Hyunsik Choi
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development