You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "xiangyuf (via GitHub)" <gi...@apache.org> on 2025/03/27 11:16:19 UTC

[PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

xiangyuf opened a new pull request, #26361:
URL: https://github.com/apache/flink/pull/26361

   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   *(For example: This pull request makes task deployment go through the blob server, rather than through RPC. That way we avoid re-transferring them on each deployment (during recovery).)*
   
   
   ## Brief change log
   
   *(for example:)*
     - Introduce new SupportsTargetColumnWriting sink ability and TargetColumnWritingSpec
   
   
   ## Verifying this change
   
   Please make sure both new and modified tests in this PR follow [the conventions for tests defined in our code quality guide](https://flink.apache.org/how-to-contribute/code-style-and-quality-common/#7-testing).
   
   *(Please pick either of the following options)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   DynamicTableSinkSpecSerdeTest#testDynamicTableSinkSpecSerde
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: yes
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? yes
     - If yes, how is the feature documented?  FLIP-506
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "xiangyuf (via GitHub)" <gi...@apache.org>.
xiangyuf commented on PR #26361:
URL: https://github.com/apache/flink/pull/26361#issuecomment-2758012394

   cc: @reswqa 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "xuyangzhong (via GitHub)" <gi...@apache.org>.
xuyangzhong commented on code in PR #26361:
URL: https://github.com/apache/flink/pull/26361#discussion_r2041966938


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/connector/sink/abilities/SupportsTargetColumnWriting.java:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.connector.sink.abilities;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.table.connector.sink.DynamicTableSink;
+
+/**
+ * Interface for {@link DynamicTableSink}s that support target column writing.
+ *
+ * <p>The planner will parse target columns from the DML clause and call {@link
+ * #applyTargetColumns(int[][])} to pass an array of column index paths to the sink.
+ *
+ * <p>The array indices are 0-based and support composite columns within (possibly nested)
+ * structures. This information comes from the column list of the DML clause, e.g., for a sink table
+ * t1 whose schema is: {@code a STRING, b ROW < b1 INT, b2 STRING>, c BIGINT}
+ *
+ * <ul>
+ *   <li>insert: 'insert into t1(a, b.b2) ...', the column list will be 'a, b.b2', and will provide
+ *       {@code [[0], [1, 1]]}. The statement 'insert into t1 select ...' will provide an empty

Review Comment:
   nit: does `insert into t1 select ...` provide null target columns and will not call the method of this interface?



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "xiangyuf (via GitHub)" <gi...@apache.org>.
xiangyuf commented on PR #26361:
URL: https://github.com/apache/flink/pull/26361#issuecomment-2801486761

   > This pr looks pretty good to me. I just left one minor comment.
   
   @xuyangzhong  Resolved. Thx for review.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #26361:
URL: https://github.com/apache/flink/pull/26361#issuecomment-2757684566

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b892cb63ec5660eab99067d76f3f5748cdeab6a7",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "b892cb63ec5660eab99067d76f3f5748cdeab6a7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b892cb63ec5660eab99067d76f3f5748cdeab6a7 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #26361:
URL: https://github.com/apache/flink/pull/26361#discussion_r2026916363


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/connector/sink/abilities/SupportsTargetColumnWriting.java:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.connector.sink.abilities;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.table.connector.sink.DynamicTableSink;
+
+/**
+ * Interface for {@link DynamicTableSink}s that support target column writing.
+ *
+ * <p>The planner will parse target columns from the DML clause and call {@link
+ * #applyTargetColumns(int[][])} to pass an array of column index paths to sink.
+ *
+ * <p>The array indices are 0-based and support composite columns within (possibly nested)
+ * structures. This information comes from the column list of the DML clause, e.g., for a sink table
+ * t1 which schema is: {@code a STRING, b ROW < b1 INT, b2 STRING>, c BIGINT}
+ *
+ * <ul>
+ *   <li>insert: 'insert into t1(a, b.b2) ...', the column list will be 'a, b.b2', and will provide

Review Comment:
   I like all the detail in the comment :-) 
   
   I find this entry in the list confusing. what does the sentence "The statement 'insert into t1 select ...' will not apply this ability."
   
   I assume the ability is whether it supports target column writing, which means when this interface is implemented. It seems there are cases when the interface is implemented, but the ability (target column writing) is not applied. It would be good to show examples where the ability is applied and examples where it is not. This list entry says the ability is not applied for an insert, what is the reason behind this?
   
   Have I understood this correctly?  
   
   
     



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "xiangyuf (via GitHub)" <gi...@apache.org>.
xiangyuf commented on code in PR #26361:
URL: https://github.com/apache/flink/pull/26361#discussion_r2041135897


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/serde/DynamicTableSinkSpecSerdeTest.java:
##########
@@ -173,7 +174,36 @@ static Stream<DynamicTableSinkSpec> testDynamicTableSinkSpecSerde() {
                                         RowType.of(new BigIntType(), new IntType()))),
                         null);
 
-        return Stream.of(spec1, spec2, spec3);
+        Map<String, String> options4 = new HashMap<>();
+        options4.put("connector", TestValuesTableFactory.IDENTIFIER);
+        int[][] targetColumnIndices = new int[][] {{0}, {1}};
+
+        final ResolvedSchema resolvedSchema4 =
+                new ResolvedSchema(
+                        Arrays.asList(
+                                Column.physical("a", DataTypes.BIGINT()),

Review Comment:
   I've added a todo in the comment. Add more complex test cases after FLINK-31301 has been 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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #26361:
URL: https://github.com/apache/flink/pull/26361#discussion_r2026919872


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/connector/sink/abilities/SupportsTargetColumnWriting.java:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.connector.sink.abilities;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.table.connector.sink.DynamicTableSink;
+
+/**
+ * Interface for {@link DynamicTableSink}s that support target column writing.
+ *
+ * <p>The planner will parse target columns from the DML clause and call {@link
+ * #applyTargetColumns(int[][])} to pass an array of column index paths to sink.

Review Comment:
   nit: to ink -> to the sink.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "reswqa (via GitHub)" <gi...@apache.org>.
reswqa commented on PR #26361:
URL: https://github.com/apache/flink/pull/26361#issuecomment-2760098576

   +cc @xuyangzhong 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "xuyangzhong (via GitHub)" <gi...@apache.org>.
xuyangzhong merged PR #26361:
URL: https://github.com/apache/flink/pull/26361


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #26361:
URL: https://github.com/apache/flink/pull/26361#discussion_r2026929581


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/serde/DynamicTableSinkSpecSerdeTest.java:
##########
@@ -173,7 +174,36 @@ static Stream<DynamicTableSinkSpec> testDynamicTableSinkSpecSerde() {
                                         RowType.of(new BigIntType(), new IntType()))),
                         null);
 
-        return Stream.of(spec1, spec2, spec3);
+        Map<String, String> options4 = new HashMap<>();
+        options4.put("connector", TestValuesTableFactory.IDENTIFIER);
+        int[][] targetColumnIndices = new int[][] {{0}, {1}};
+
+        final ResolvedSchema resolvedSchema4 =
+                new ResolvedSchema(
+                        Arrays.asList(
+                                Column.physical("a", DataTypes.BIGINT()),

Review Comment:
   Could we have a more complex schema in the test? I suggest including maps, nesting with objects and nested arrays, and arrays of objects.
    I am curious if writing nulls to nullable columns is a consideration here; if so maybe a test to ensure that works?  



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "xiangyuf (via GitHub)" <gi...@apache.org>.
xiangyuf commented on PR #26361:
URL: https://github.com/apache/flink/pull/26361#issuecomment-2757676108

   @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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "xiangyuf (via GitHub)" <gi...@apache.org>.
xiangyuf commented on PR #26361:
URL: https://github.com/apache/flink/pull/26361#issuecomment-2757761612

   @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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "xiangyuf (via GitHub)" <gi...@apache.org>.
xiangyuf commented on PR #26361:
URL: https://github.com/apache/flink/pull/26361#issuecomment-2801018240

   CI Passed. Kindly remind for review @davidradl @xuyangzhong 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "xiangyuf (via GitHub)" <gi...@apache.org>.
xiangyuf commented on code in PR #26361:
URL: https://github.com/apache/flink/pull/26361#discussion_r2041135636


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/connector/sink/abilities/SupportsTargetColumnWriting.java:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.connector.sink.abilities;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.table.connector.sink.DynamicTableSink;
+
+/**
+ * Interface for {@link DynamicTableSink}s that support target column writing.
+ *
+ * <p>The planner will parse target columns from the DML clause and call {@link
+ * #applyTargetColumns(int[][])} to pass an array of column index paths to sink.
+ *
+ * <p>The array indices are 0-based and support composite columns within (possibly nested)
+ * structures. This information comes from the column list of the DML clause, e.g., for a sink table
+ * t1 which schema is: {@code a STRING, b ROW < b1 INT, b2 STRING>, c BIGINT}
+ *
+ * <ul>
+ *   <li>insert: 'insert into t1(a, b.b2) ...', the column list will be 'a, b.b2', and will provide

Review Comment:
   Hi @davidradl , I've changed the comments to `The statement 'insert into t1 select ...' will provide an empty list.`



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "xiangyuf (via GitHub)" <gi...@apache.org>.
xiangyuf commented on code in PR #26361:
URL: https://github.com/apache/flink/pull/26361#discussion_r2041134455


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/serde/DynamicTableSinkSpecSerdeTest.java:
##########
@@ -173,7 +174,36 @@ static Stream<DynamicTableSinkSpec> testDynamicTableSinkSpecSerde() {
                                         RowType.of(new BigIntType(), new IntType()))),
                         null);
 
-        return Stream.of(spec1, spec2, spec3);
+        Map<String, String> options4 = new HashMap<>();
+        options4.put("connector", TestValuesTableFactory.IDENTIFIER);
+        int[][] targetColumnIndices = new int[][] {{0}, {1}};
+
+        final ResolvedSchema resolvedSchema4 =
+                new ResolvedSchema(
+                        Arrays.asList(
+                                Column.physical("a", DataTypes.BIGINT()),

Review Comment:
   @davidradl thx for comments. However, nested columns is not supported by target columns currently. See more in this issue: https://issues.apache.org/jira/browse/FLINK-31301



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #26361:
URL: https://github.com/apache/flink/pull/26361#discussion_r2026929581


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/serde/DynamicTableSinkSpecSerdeTest.java:
##########
@@ -173,7 +174,36 @@ static Stream<DynamicTableSinkSpec> testDynamicTableSinkSpecSerde() {
                                         RowType.of(new BigIntType(), new IntType()))),
                         null);
 
-        return Stream.of(spec1, spec2, spec3);
+        Map<String, String> options4 = new HashMap<>();
+        options4.put("connector", TestValuesTableFactory.IDENTIFIER);
+        int[][] targetColumnIndices = new int[][] {{0}, {1}};
+
+        final ResolvedSchema resolvedSchema4 =
+                new ResolvedSchema(
+                        Arrays.asList(
+                                Column.physical("a", DataTypes.BIGINT()),

Review Comment:
   Could we have a more complex schema in the test, I suggest nesting with objects and nested arrays, and arrays of objects?
    I am curious if writing nulls to nullable columns is a consideration here; if so maybe a test to ensure that works?  



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-37540][table-planner] Introduce SupportsTargetColumnWriting sink ability [flink]

Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #26361:
URL: https://github.com/apache/flink/pull/26361#discussion_r2026904368


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/connector/sink/abilities/SupportsTargetColumnWriting.java:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.connector.sink.abilities;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.table.connector.sink.DynamicTableSink;
+
+/**
+ * Interface for {@link DynamicTableSink}s that support target column writing.
+ *
+ * <p>The planner will parse target columns from the DML clause and call {@link
+ * #applyTargetColumns(int[][])} to pass an array of column index paths to sink.
+ *
+ * <p>The array indices are 0-based and support composite columns within (possibly nested)
+ * structures. This information comes from the column list of the DML clause, e.g., for a sink table
+ * t1 which schema is: {@code a STRING, b ROW < b1 INT, b2 STRING>, c BIGINT}

Review Comment:
   nit: which -> whose



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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