You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Aitozi (via GitHub)" <gi...@apache.org> on 2023/04/11 10:11:28 UTC

[GitHub] [flink] Aitozi opened a new pull request, #22378: [FLINK-31344][planner] Support to update nested columns in update sta…

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

   …tement
   
   ## What is the purpose of the change
   
   This PR is meant to support update nested column in update. 
   
   
   ## Brief change log
   
   - Add FlinkSqlUpdate parser section to overwrite the SqlUpdate 
   - Remove the validate for `SqlUpdate` rowType in `SqlValidatorImpl.java`. It's done in the table environment, same to the SqlInsert
   - Creating `Row` projection for the nested column 
   
   
   ## Verifying this change
   
   - RowLevelUpdateTest
   - UpdateTableITCase
   
   ## 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, Kubernetes/Yarn, 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.

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

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


[GitHub] [flink] flinkbot commented on pull request #22378: [FLINK-31344][planner] Support to update nested columns in update sta…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "74d15fcd03220240037adddc43b0e1455aebc9ad",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "74d15fcd03220240037adddc43b0e1455aebc9ad",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 74d15fcd03220240037adddc43b0e1455aebc9ad 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


[GitHub] [flink] Aitozi commented on a diff in pull request #22378: [FLINK-31344][planner] Support to update nested columns in update sta…

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


##########
flink-table/flink-table-planner/src/test/resources/org/apache/flink/table/planner/plan/batch/sql/RowLevelUpdateTest.xml:
##########
@@ -20,17 +20,17 @@ limitations under the License.
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalSink(table=[default_catalog.default_database.t], targetColumns=[[1],[0],[2]], fields=[a, b, c])
-+- LogicalProject(a=[IF(>($2, 123), 123, $0)], b=[IF(>($2, 123), _UTF-16LE'v2', $1)], c=[IF(>($2, 123), +($2, 1), $2)])
++- LogicalProject(a=[CASE(>($2, 123), 123, $0)], b=[CASE(>($2, 123), _UTF-16LE'v2', $1)], c=[CASE(>($2, 123), +($2, 1), $2)])

Review Comment:
   I use `CASE` to replace `IF`, because the `IF` can not handle `ROW` type.



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


[GitHub] [flink] Aitozi commented on pull request #22378: [FLINK-31344][planner] Support to update nested columns in update sta…

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

   ping @luoyuxia 


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


[GitHub] [flink] Aitozi commented on a diff in pull request #22378: [FLINK-31344][planner] Support to update nested columns in update sta…

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


##########
flink-table/flink-table-planner/src/test/resources/org/apache/flink/table/planner/plan/batch/sql/RowLevelUpdateTest.xml:
##########
@@ -20,17 +20,17 @@ limitations under the License.
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalSink(table=[default_catalog.default_database.t], targetColumns=[[1],[0],[2]], fields=[a, b, c])
-+- LogicalProject(a=[IF(>($2, 123), 123, $0)], b=[IF(>($2, 123), _UTF-16LE'v2', $1)], c=[IF(>($2, 123), +($2, 1), $2)])
++- LogicalProject(a=[CASE(>($2, 123), 123, $0)], b=[CASE(>($2, 123), _UTF-16LE'v2', $1)], c=[CASE(>($2, 123), +($2, 1), $2)])

Review Comment:
   FYI: `IF` function should work with numeric type, `CASE` can replace it 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.

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

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


[GitHub] [flink] Aitozi commented on a diff in pull request #22378: [FLINK-31344][planner] Support to update nested columns in update sta…

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


##########
flink-table/flink-table-planner/src/test/resources/org/apache/flink/table/planner/plan/batch/sql/RowLevelUpdateTest.xml:
##########
@@ -20,17 +20,17 @@ limitations under the License.
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalSink(table=[default_catalog.default_database.t], targetColumns=[[1],[0],[2]], fields=[a, b, c])
-+- LogicalProject(a=[IF(>($2, 123), 123, $0)], b=[IF(>($2, 123), _UTF-16LE'v2', $1)], c=[IF(>($2, 123), +($2, 1), $2)])
++- LogicalProject(a=[CASE(>($2, 123), 123, $0)], b=[CASE(>($2, 123), _UTF-16LE'v2', $1)], c=[CASE(>($2, 123), +($2, 1), $2)])

Review Comment:
   FYI: `IF` function should work with numeric type, `CASE` can replace it 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.

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

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


[GitHub] [flink] Aitozi commented on a diff in pull request #22378: [FLINK-31344][planner] Support to update nested columns in update sta…

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


##########
flink-table/flink-table-planner/src/test/resources/org/apache/flink/table/planner/plan/batch/sql/RowLevelUpdateTest.xml:
##########
@@ -20,17 +20,17 @@ limitations under the License.
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalSink(table=[default_catalog.default_database.t], targetColumns=[[1],[0],[2]], fields=[a, b, c])
-+- LogicalProject(a=[IF(>($2, 123), 123, $0)], b=[IF(>($2, 123), _UTF-16LE'v2', $1)], c=[IF(>($2, 123), +($2, 1), $2)])
++- LogicalProject(a=[CASE(>($2, 123), 123, $0)], b=[CASE(>($2, 123), _UTF-16LE'v2', $1)], c=[CASE(>($2, 123), +($2, 1), $2)])

Review Comment:
   I use `CASE` to replace `IF`, because the `IF` can not handle `ROW` field well, I will have another test/jira for this after verified.



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