You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/02/22 03:21:22 UTC

[GitHub] [flink] docete opened a new pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

docete opened a new pull request #14977:
URL: https://github.com/apache/flink/pull/14977


   …ns in blink planner
   
   ## What is the purpose of the change
   
   This PR supports INSERT INTO specific columns in blink planner.
   
   ## Brief change log
   
   - aa8dede: Support INSERT INTO specific columns in blink planner
   
   ## Verifying this change
   
   This change added tests.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (**yes** / no)
     - If yes, how is the feature documented? (not applicable / docs / **JavaDocs** / not documented)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783038390


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit aa8dede9e64d4c012d0cacc831d5993ec7fa9d06 (Mon Feb 22 03:24:06 UTC 2021)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wuchong commented on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783061626


   cc @leonardBang 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cbb43f980354f2a108ec2f40fe4e7c194c7f73a1 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wuchong commented on a change in pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #14977:
URL: https://github.com/apache/flink/pull/14977#discussion_r582641238



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/table/TableSinkITCase.scala
##########
@@ -207,4 +212,336 @@ class TableSinkITCase extends BatchTestBase {
     val expected = List("book,1,12", "book,4,11", "fruit,3,44")
     assertEquals(expected.sorted, result.sorted)
   }
+
+  @Test
+  def testSinkWithPartitionAndComputedColumn(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` AS `a` + 1,
+         |  `c` STRING,
+         |  `d` INT,
+         |  `e` DOUBLE
+         |)
+         |PARTITIONED BY (`c`, `d`)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink PARTITION(`c`='2021', `d`=1)
+         |SELECT x, sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "1,2021,1,0.1",
+      "2,2021,1,0.4",
+      "3,2021,1,1.0",
+      "4,2021,1,2.2",
+      "5,2021,1,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testPartialInsert(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` DOUBLE
+         |)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink (b)
+         |SELECT sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "null,0.1",
+      "null,0.4",
+      "null,1.0",
+      "null,2.2",
+      "null,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testPartialInsertWithNotNullColumn(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT NOT NULL,
+         |  `b` DOUBLE
+         |)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    expectedEx.expect(classOf[ValidationException])
+    expectedEx.expectMessage("Column 'a' has no default value and does not allow NULLs")
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink (b)
+         |SELECT sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+  }
+
+  @Test
+  def testPartialInsertWithPartitionAndComputedColumn(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` AS `a` + 1,
+         |  `c` STRING,
+         |  `d` INT,
+         |  `e` DOUBLE
+         |)
+         |PARTITIONED BY (`c`, `d`)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink PARTITION(`c`='2021', `d`=1) (e)
+         |SELECT sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "null,2021,1,0.1",
+      "null,2021,1,0.4",
+      "null,2021,1,1.0",
+      "null,2021,1,2.2",
+      "null,2021,1,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testFullInsertWithPartitionAndComputedColumn(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` AS `a` + 1,
+         |  `c` STRING,
+         |  `d` INT,
+         |  `e` DOUBLE
+         |)
+         |PARTITIONED BY (`c`, `d`)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink PARTITION(`c`='2021', `d`=1) (a, e)
+         |SELECT x, sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "1,2021,1,0.1",
+      "2,2021,1,0.4",
+      "3,2021,1,1.0",
+      "4,2021,1,2.2",
+      "5,2021,1,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testPartialInsertWithDynamicPartitionAndComputedColumn1(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` AS `a` + 1,
+         |  `c` STRING,
+         |  `d` INT,
+         |  `e` DOUBLE
+         |)
+         |PARTITIONED BY (`c`, `d`)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink (e)
+         |SELECT sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "null,null,null,0.1",
+      "null,null,null,0.4",
+      "null,null,null,1.0",
+      "null,null,null,2.2",
+      "null,null,null,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testPartialInsertWithDynamicPartitionAndComputedColumn2(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` AS `a` + 1,
+         |  `c` STRING,
+         |  `d` INT,
+         |  `e` DOUBLE
+         |)
+         |PARTITIONED BY (`c`, `d`)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink (c, d, e)

Review comment:
       Could you add a test which reorder the specified columns, e.g. `INSERT INTO .. (e, c, d)`. I tried in my local machine and it fails. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wuchong commented on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-787883111


   The failed e2e is because of time out. 
   Will merge this PR.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * aa8dede9e64d4c012d0cacc831d5993ec7fa9d06 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] JingsongLi commented on a change in pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #14977:
URL: https://github.com/apache/flink/pull/14977#discussion_r591213360



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/PreValidateReWriter.scala
##########
@@ -191,41 +267,40 @@ object PreValidateReWriter {
     SqlStdOperatorTable.VALUES.createCall(values.getParserPosition, fixedNodes)
   }
 
+  private def reorder(
+      sourceList: util.ArrayList[SqlNode],
+      targetPosition: util.List[Int]): util.ArrayList[SqlNode] = {
+    val targetList = new Array[SqlNode](sourceList.size())
+    0 until sourceList.size() foreach {
+      idx => targetList(targetPosition.get(idx)) = sourceList.get(idx)

Review comment:
       ```
   @Test
     def testPartialInsertWithComplexReorder(): Unit = {
       tEnv.executeSql(
         s"""
            |CREATE TABLE testSink (
            |  `a` INT,
            |  `c` STRING,
            |  `c1` STRING,
            |  `c2` STRING,
            |  `c3` BIGINT,
            |  `d` INT,
            |  `e` DOUBLE
            |)
            |WITH (
            |  'connector' = 'values',
            |  'sink-insert-only' = 'false'
            |)
            |""".stripMargin)
   
       val t = env.fromCollection(tupleData2).toTable(tEnv, 'x, 'y)
       tEnv.createTemporaryView("MyTable", t)
   
       tEnv.executeSql(
         s"""
            |INSERT INTO testSink (a,c2,e,c,c1,c3,d)
            |SELECT 1,'c2',sum(y),'c','c1',33333,12 FROM MyTable GROUP BY x
            |""".stripMargin).await()
       val expected = List(
         "1,c,c1,c2,33333,12,0.1",
         "1,c,c1,c2,33333,12,0.4",
         "1,c,c1,c2,33333,12,1.0",
         "1,c,c1,c2,33333,12,2.2",
         "1,c,c1,c2,33333,12,3.9")
       val result = TestValuesTableFactory.getResults("testSink")
       assertEquals(expected.sorted, result.sorted)
     }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13746",
       "triggerID" : "785662256",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "785662256",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "f192b8004df17d464706636e62fd332df8d27804",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f192b8004df17d464706636e62fd332df8d27804",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cbb43f980354f2a108ec2f40fe4e7c194c7f73a1 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13746) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672) 
   * f192b8004df17d464706636e62fd332df8d27804 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wuchong commented on a change in pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #14977:
URL: https://github.com/apache/flink/pull/14977#discussion_r591206961



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/PreValidateReWriter.scala
##########
@@ -191,41 +267,40 @@ object PreValidateReWriter {
     SqlStdOperatorTable.VALUES.createCall(values.getParserPosition, fixedNodes)
   }
 
+  private def reorder(
+      sourceList: util.ArrayList[SqlNode],
+      targetPosition: util.List[Int]): util.ArrayList[SqlNode] = {
+    val targetList = new Array[SqlNode](sourceList.size())
+    0 until sourceList.size() foreach {
+      idx => targetList(targetPosition.get(idx)) = sourceList.get(idx)

Review comment:
       Is there any cases to prove this?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] leonardBang commented on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
leonardBang commented on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-784862283


   > https://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/sqlexec/SqlToOperationConverter.java
   > 
   > ```
   > else if (validated instanceof RichSqlInsert) {
   >             SqlNodeList targetColumnList = ((RichSqlInsert) validated).getTargetColumnList();
   >             if (targetColumnList != null && targetColumnList.size() != 0) {
   >                 throw new ValidationException("Partial inserts are not supported");
   >             }
   >             return Optional.of(converter.convertSqlInsert((RichSqlInsert) validated));
   >         }
   > ```
   > 
   > Does it need to be changed here?
   
   I think we do not need change this piece, I suggest 
   
   > https://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/sqlexec/SqlToOperationConverter.java
   > 
   > ```
   > else if (validated instanceof RichSqlInsert) {
   >             SqlNodeList targetColumnList = ((RichSqlInsert) validated).getTargetColumnList();
   >             if (targetColumnList != null && targetColumnList.size() != 0) {
   >                 throw new ValidationException("Partial inserts are not supported");
   >             }
   >             return Optional.of(converter.convertSqlInsert((RichSqlInsert) validated));
   >         }
   > ```
   > 
   > Does it need to be changed here?
   
   Nice catch, I think we can remove this check safely . @docete 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13746",
       "triggerID" : "785662256",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "785662256",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * cbb43f980354f2a108ec2f40fe4e7c194c7f73a1 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13746) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] sllence commented on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
sllence commented on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-784740389


   [https://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/sqlexec/SqlToOperationConverter.java](https://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/sqlexec/SqlToOperationConverter.java)
   ```
   else if (validated instanceof RichSqlInsert) {
               SqlNodeList targetColumnList = ((RichSqlInsert) validated).getTargetColumnList();
               if (targetColumnList != null && targetColumnList.size() != 0) {
                   throw new ValidationException("Partial inserts are not supported");
               }
               return Optional.of(converter.convertSqlInsert((RichSqlInsert) validated));
           }
   ```
   Does it need to be changed here?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] docete commented on a change in pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
docete commented on a change in pull request #14977:
URL: https://github.com/apache/flink/pull/14977#discussion_r580727685



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/table/TableSinkITCase.scala
##########
@@ -838,6 +842,311 @@ class TableSinkITCase extends StreamingTestBase {
 
   }
 
+  @Test
+  def testPartialInsert(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` DOUBLE
+         |)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'false'
+         |)
+         |""".stripMargin)
+
+    val t = env.fromCollection(tupleData2).toTable(tEnv, 'x, 'y)
+    tEnv.createTemporaryView("MyTable", t)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink (b)
+         |SELECT sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "null,0.1",
+      "null,0.4",
+      "null,1.0",
+      "null,2.2",
+      "null,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testPartialInsertWithNotNullColumn(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT NOT NULL,
+         |  `b` DOUBLE
+         |)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'false'
+         |)
+         |""".stripMargin)
+
+    val t = env.fromCollection(tupleData2).toTable(tEnv, 'x, 'y)
+    tEnv.createTemporaryView("MyTable", t)
+
+    expectedEx.expect(classOf[ValidationException])
+    expectedEx.expectMessage("Column 'a' has no default value and does not allow NULLs")

Review comment:
       sounds good, will update soon.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] leonardBang edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
leonardBang edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-784862283


   > https://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/sqlexec/SqlToOperationConverter.java
   > 
   > ```
   > else if (validated instanceof RichSqlInsert) {
   >             SqlNodeList targetColumnList = ((RichSqlInsert) validated).getTargetColumnList();
   >             if (targetColumnList != null && targetColumnList.size() != 0) {
   >                 throw new ValidationException("Partial inserts are not supported");
   >             }
   >             return Optional.of(converter.convertSqlInsert((RichSqlInsert) validated));
   >         }
   > ```
   > 
   > Does it need to be changed here?
   
   Nice catch, I think we can remove this check safely . @docete 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13746",
       "triggerID" : "785662256",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "785662256",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "f192b8004df17d464706636e62fd332df8d27804",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13912",
       "triggerID" : "f192b8004df17d464706636e62fd332df8d27804",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cbb43f980354f2a108ec2f40fe4e7c194c7f73a1 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13746) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672) 
   * f192b8004df17d464706636e62fd332df8d27804 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13912) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b596a1dded4d768f64b785205d1ce01ff79671b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618) 
   * cbb43f980354f2a108ec2f40fe4e7c194c7f73a1 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] docete commented on a change in pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
docete commented on a change in pull request #14977:
URL: https://github.com/apache/flink/pull/14977#discussion_r581667233



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/table/TableSinkITCase.scala
##########
@@ -838,6 +842,311 @@ class TableSinkITCase extends StreamingTestBase {
 
   }
 
+  @Test
+  def testPartialInsert(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` DOUBLE
+         |)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'false'
+         |)
+         |""".stripMargin)
+
+    val t = env.fromCollection(tupleData2).toTable(tEnv, 'x, 'y)
+    tEnv.createTemporaryView("MyTable", t)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink (b)
+         |SELECT sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "null,0.1",
+      "null,0.4",
+      "null,1.0",
+      "null,2.2",
+      "null,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testPartialInsertWithNotNullColumn(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT NOT NULL,
+         |  `b` DOUBLE
+         |)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'false'
+         |)
+         |""".stripMargin)
+
+    val t = env.fromCollection(tupleData2).toTable(tEnv, 'x, 'y)
+    tEnv.createTemporaryView("MyTable", t)
+
+    expectedEx.expect(classOf[ValidationException])
+    expectedEx.expectMessage("Column 'a' has no default value and does not allow NULLs")

Review comment:
       Check the error msg again and found the original one is more accuracy. So i will revert the change.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * aa8dede9e64d4c012d0cacc831d5993ec7fa9d06 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552) 
   * 9b596a1dded4d768f64b785205d1ce01ff79671b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wuchong commented on a change in pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #14977:
URL: https://github.com/apache/flink/pull/14977#discussion_r591206961



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/PreValidateReWriter.scala
##########
@@ -191,41 +267,40 @@ object PreValidateReWriter {
     SqlStdOperatorTable.VALUES.createCall(values.getParserPosition, fixedNodes)
   }
 
+  private def reorder(
+      sourceList: util.ArrayList[SqlNode],
+      targetPosition: util.List[Int]): util.ArrayList[SqlNode] = {
+    val targetList = new Array[SqlNode](sourceList.size())
+    0 until sourceList.size() foreach {
+      idx => targetList(targetPosition.get(idx)) = sourceList.get(idx)

Review comment:
       Is there any tests to prove this?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13746",
       "triggerID" : "785662256",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "785662256",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * cbb43f980354f2a108ec2f40fe4e7c194c7f73a1 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13746) Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b596a1dded4d768f64b785205d1ce01ff79671b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618) 
   * cbb43f980354f2a108ec2f40fe4e7c194c7f73a1 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] leonardBang commented on a change in pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
leonardBang commented on a change in pull request #14977:
URL: https://github.com/apache/flink/pull/14977#discussion_r580122931



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/table/TableSinkITCase.scala
##########
@@ -838,6 +842,311 @@ class TableSinkITCase extends StreamingTestBase {
 
   }
 
+  @Test
+  def testPartialInsert(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` DOUBLE
+         |)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'false'
+         |)
+         |""".stripMargin)
+
+    val t = env.fromCollection(tupleData2).toTable(tEnv, 'x, 'y)
+    tEnv.createTemporaryView("MyTable", t)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink (b)
+         |SELECT sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "null,0.1",
+      "null,0.4",
+      "null,1.0",
+      "null,2.2",
+      "null,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testPartialInsertWithNotNullColumn(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT NOT NULL,
+         |  `b` DOUBLE
+         |)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'false'
+         |)
+         |""".stripMargin)
+
+    val t = env.fromCollection(tupleData2).toTable(tEnv, 'x, 'y)
+    tEnv.createTemporaryView("MyTable", t)
+
+    expectedEx.expect(classOf[ValidationException])
+    expectedEx.expectMessage("Column 'a' has no default value and does not allow NULLs")

Review comment:
       Flink does not support default value yet, we can improve exception message here, how about improve to 
   ```suggestion
       expectedEx.expectMessage("Column 'a' does not allow NULL value, thus it can not be used in partial insert")
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] docete commented on a change in pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
docete commented on a change in pull request #14977:
URL: https://github.com/apache/flink/pull/14977#discussion_r584449925



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/table/TableSinkITCase.scala
##########
@@ -207,4 +212,336 @@ class TableSinkITCase extends BatchTestBase {
     val expected = List("book,1,12", "book,4,11", "fruit,3,44")
     assertEquals(expected.sorted, result.sorted)
   }
+
+  @Test
+  def testSinkWithPartitionAndComputedColumn(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` AS `a` + 1,
+         |  `c` STRING,
+         |  `d` INT,
+         |  `e` DOUBLE
+         |)
+         |PARTITIONED BY (`c`, `d`)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink PARTITION(`c`='2021', `d`=1)
+         |SELECT x, sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "1,2021,1,0.1",
+      "2,2021,1,0.4",
+      "3,2021,1,1.0",
+      "4,2021,1,2.2",
+      "5,2021,1,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testPartialInsert(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` DOUBLE
+         |)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink (b)
+         |SELECT sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "null,0.1",
+      "null,0.4",
+      "null,1.0",
+      "null,2.2",
+      "null,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testPartialInsertWithNotNullColumn(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT NOT NULL,
+         |  `b` DOUBLE
+         |)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    expectedEx.expect(classOf[ValidationException])
+    expectedEx.expectMessage("Column 'a' has no default value and does not allow NULLs")
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink (b)
+         |SELECT sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+  }
+
+  @Test
+  def testPartialInsertWithPartitionAndComputedColumn(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` AS `a` + 1,
+         |  `c` STRING,
+         |  `d` INT,
+         |  `e` DOUBLE
+         |)
+         |PARTITIONED BY (`c`, `d`)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink PARTITION(`c`='2021', `d`=1) (e)
+         |SELECT sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "null,2021,1,0.1",
+      "null,2021,1,0.4",
+      "null,2021,1,1.0",
+      "null,2021,1,2.2",
+      "null,2021,1,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testFullInsertWithPartitionAndComputedColumn(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` AS `a` + 1,
+         |  `c` STRING,
+         |  `d` INT,
+         |  `e` DOUBLE
+         |)
+         |PARTITIONED BY (`c`, `d`)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink PARTITION(`c`='2021', `d`=1) (a, e)
+         |SELECT x, sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "1,2021,1,0.1",
+      "2,2021,1,0.4",
+      "3,2021,1,1.0",
+      "4,2021,1,2.2",
+      "5,2021,1,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testPartialInsertWithDynamicPartitionAndComputedColumn1(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` AS `a` + 1,
+         |  `c` STRING,
+         |  `d` INT,
+         |  `e` DOUBLE
+         |)
+         |PARTITIONED BY (`c`, `d`)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink (e)
+         |SELECT sum(y) FROM MyTable GROUP BY x
+         |""".stripMargin).await()
+    val expected = List(
+      "null,null,null,0.1",
+      "null,null,null,0.4",
+      "null,null,null,1.0",
+      "null,null,null,2.2",
+      "null,null,null,3.9")
+    val result = TestValuesTableFactory.getResults("testSink")
+    assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testPartialInsertWithDynamicPartitionAndComputedColumn2(): Unit = {
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE testSink (
+         |  `a` INT,
+         |  `b` AS `a` + 1,
+         |  `c` STRING,
+         |  `d` INT,
+         |  `e` DOUBLE
+         |)
+         |PARTITIONED BY (`c`, `d`)
+         |WITH (
+         |  'connector' = 'values',
+         |  'sink-insert-only' = 'true'
+         |)
+         |""".stripMargin)
+
+    registerCollection("MyTable", simpleData2, simpleType2, "x, y", nullableOfSimpleData2)
+
+    tEnv.executeSql(
+      s"""
+         |INSERT INTO testSink (c, d, e)

Review comment:
       fixed. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wuchong merged pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
wuchong merged pull request #14977:
URL: https://github.com/apache/flink/pull/14977


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13746",
       "triggerID" : "785662256",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "785662256",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "f192b8004df17d464706636e62fd332df8d27804",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13912",
       "triggerID" : "f192b8004df17d464706636e62fd332df8d27804",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f192b8004df17d464706636e62fd332df8d27804 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13912) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] JingsongLi commented on a change in pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #14977:
URL: https://github.com/apache/flink/pull/14977#discussion_r591213970



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/PreValidateReWriter.scala
##########
@@ -191,41 +267,40 @@ object PreValidateReWriter {
     SqlStdOperatorTable.VALUES.createCall(values.getParserPosition, fixedNodes)
   }
 
+  private def reorder(
+      sourceList: util.ArrayList[SqlNode],
+      targetPosition: util.List[Int]): util.ArrayList[SqlNode] = {
+    val targetList = new Array[SqlNode](sourceList.size())
+    0 until sourceList.size() foreach {
+      idx => targetList(targetPosition.get(idx)) = sourceList.get(idx)

Review comment:
       BTW, I think we should use plan testing instead of itcase.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] JingsongLi commented on a change in pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #14977:
URL: https://github.com/apache/flink/pull/14977#discussion_r591191743



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/PreValidateReWriter.scala
##########
@@ -191,41 +267,40 @@ object PreValidateReWriter {
     SqlStdOperatorTable.VALUES.createCall(values.getParserPosition, fixedNodes)
   }
 
+  private def reorder(
+      sourceList: util.ArrayList[SqlNode],
+      targetPosition: util.List[Int]): util.ArrayList[SqlNode] = {
+    val targetList = new Array[SqlNode](sourceList.size())
+    0 until sourceList.size() foreach {
+      idx => targetList(targetPosition.get(idx)) = sourceList.get(idx)

Review comment:
       Here should be `idx => targetList(idx) = sourceList.get(targetPosition.get(idx))` What do you think? @leonardBang @wuchong 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * aa8dede9e64d4c012d0cacc831d5993ec7fa9d06 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9b596a1dded4d768f64b785205d1ce01ff79671b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * aa8dede9e64d4c012d0cacc831d5993ec7fa9d06 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552) 
   * 9b596a1dded4d768f64b785205d1ce01ff79671b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * aa8dede9e64d4c012d0cacc831d5993ec7fa9d06 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] docete commented on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
docete commented on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-785662256


   @flinkbot run azure


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] sllence commented on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
sllence commented on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-784935998


   > > https://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/sqlexec/SqlToOperationConverter.java
   > > ```
   > > else if (validated instanceof RichSqlInsert) {
   > >             SqlNodeList targetColumnList = ((RichSqlInsert) validated).getTargetColumnList();
   > >             if (targetColumnList != null && targetColumnList.size() != 0) {
   > >                 throw new ValidationException("Partial inserts are not supported");
   > >             }
   > >             return Optional.of(converter.convertSqlInsert((RichSqlInsert) validated));
   > >         }
   > > ```
   > > 
   > > 
   > > Does it need to be changed here?
   > 
   > Nice catch, I think we can remove this check safely . @docete
   
   Sorry,I've looked at it again. This verification is in the old planner. It should not be modified


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #14977: [FLINK-18726][table-planner-blink] Support INSERT INTO specific colum…

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14977:
URL: https://github.com/apache/flink/pull/14977#issuecomment-783054931


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13552",
       "triggerID" : "aa8dede9e64d4c012d0cacc831d5993ec7fa9d06",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13618",
       "triggerID" : "9b596a1dded4d768f64b785205d1ce01ff79671b",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672",
       "triggerID" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cbb43f980354f2a108ec2f40fe4e7c194c7f73a1",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13746",
       "triggerID" : "785662256",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * cbb43f980354f2a108ec2f40fe4e7c194c7f73a1 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13672) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13746) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org