Re: [PR] [FLINK-33719][table] Cleanup the usage of deprecated StreamTableEnvir… [flink]

2024-01-18 Thread via GitHub


snuyanzin commented on PR #23898:
URL: https://github.com/apache/flink/pull/23898#issuecomment-1899850866

   @liuyongvs are you going to continuwe working on 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.

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

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



Re: [PR] [FLINK-33719][table] Cleanup the usage of deprecated StreamTableEnvir… [flink]

2023-12-15 Thread via GitHub


xuyangzhong commented on code in PR #23898:
URL: https://github.com/apache/flink/pull/23898#discussion_r1427704155


##
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/utils/RowToTuple2.scala:
##
@@ -0,0 +1,45 @@
+/*
+ * 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.planner.utils
+
+import org.apache.flink.api.common.functions.MapFunction
+import org.apache.flink.types.{Row, RowKind}
+
+/** Row to scala Tuple2. */
+class RowToTuple2 extends MapFunction[Row, (Boolean, Row)] {
+
+  /**
+   * The mapping method. Takes an element from the input data set and 
transforms it into exactly one
+   * element.
+   *
+   * @param value
+   *   The input value.
+   * @return
+   *   The transformed value
+   * @throws Exception

Review Comment:
   nit, this function does not seem to throw an exception, right?



##
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/utils/RowToTuple2.scala:
##
@@ -0,0 +1,45 @@
+/*
+ * 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.planner.utils
+
+import org.apache.flink.api.common.functions.MapFunction
+import org.apache.flink.types.{Row, RowKind}
+
+/** Row to scala Tuple2. */
+class RowToTuple2 extends MapFunction[Row, (Boolean, Row)] {
+
+  /**
+   * The mapping method. Takes an element from the input data set and 
transforms it into exactly one

Review Comment:
   What about copying the annotations from TableConversions#toRetractStream? 
   ```
 /**
  * The first field is a [[Boolean]] flag, the second field holds the 
original record with type [[Row]]. A
  * true [[Boolean]] flag indicates an add message, a false flag indicates 
a retract message.
  */
   ```



##
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/utils/RowToTuple2.scala:
##
@@ -0,0 +1,45 @@
+/*
+ * 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.planner.utils
+
+import org.apache.flink.api.common.functions.MapFunction
+import org.apache.flink.types.{Row, RowKind}
+
+/** Row to scala Tuple2. */
+class RowToTuple2 extends MapFunction[Row, (Boolean, Row)] {

Review Comment:
   Nit, the function name is not clear enough. What about using 
`Row2RowWithRetractType` or something else if you have better ideas.



##
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/harness/TableAggregateHarnessTest.scala:
##
@@ -64,7 +63,9 @@ class TableAggregateHarnessTest(mode: StateBackendMode) 
extends HarnessTestBase(
   .select('a, 'b1, 'b2)
 
 

Re: [PR] [FLINK-33719][table] Cleanup the usage of deprecated StreamTableEnvir… [flink]

2023-12-11 Thread via GitHub


liuyongvs commented on PR #23898:
URL: https://github.com/apache/flink/pull/23898#issuecomment-1849866511

   @snuyanzin and do you also help reveiw this cleanup?
   https://github.com/apache/flink/pull/23897
   https://github.com/apache/flink/pull/23895
   https://github.com/apache/flink/pull/23894


-- 
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-unsubscr...@flink.apache.org

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



Re: [PR] [FLINK-33719][table] Cleanup the usage of deprecated StreamTableEnvir… [flink]

2023-12-11 Thread via GitHub


liuyongvs commented on PR #23898:
URL: https://github.com/apache/flink/pull/23898#issuecomment-1849863462

   @snuyanzin thanks very much, I didn't notice that.


-- 
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-unsubscr...@flink.apache.org

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



Re: [PR] [FLINK-33719][table] Cleanup the usage of deprecated StreamTableEnvir… [flink]

2023-12-11 Thread via GitHub


liuyongvs commented on PR #23898:
URL: https://github.com/apache/flink/pull/23898#issuecomment-1849837960

   > Thanks for the contribution
   > 
   > 1. can you please fix PR description accordingly?
   > 2. it seems the PR does not clean up all usages (at least in planner), 
however it should
   
   hi @snuyanzin 
   1. this pr only cleanup the toRetractStream
   2. i cleanup all the usage of toRetractStream.


-- 
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-unsubscr...@flink.apache.org

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



Re: [PR] [FLINK-33719][table] Cleanup the usage of deprecated StreamTableEnvir… [flink]

2023-12-10 Thread via GitHub


liuyongvs commented on PR #23898:
URL: https://github.com/apache/flink/pull/23898#issuecomment-1849337372

   hi @snuyanzin @dawidwys could you help review 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.

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

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



Re: [PR] [FLINK-33719][table] Cleanup the usage of deprecated StreamTableEnvir… [flink]

2023-12-08 Thread via GitHub


flinkbot commented on PR #23898:
URL: https://github.com/apache/flink/pull/23898#issuecomment-1846938906

   
   ## CI report:
   
   * 8ca93097658734c4e971050970795567430f04df UNKNOWN
   
   
   Bot commands
 The @flinkbot bot supports the following commands:
   
- `@flinkbot run azure` re-run the last Azure build
   


-- 
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-unsubscr...@flink.apache.org

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



[PR] [FLINK-33719][table] Cleanup the usage of deprecated StreamTableEnvir… [flink]

2023-12-08 Thread via GitHub


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

   
   
   ## What is the purpose of the change
   
   *The PR is about to replace deprecated 
StreamTableEnvironment#toRetractDataStream with 
StreamTableEnvironment#toChangelogStream as mentioned in javadoc*
   
   
   ## Brief change log
   
   *(for example:)*
 - *The TaskInfo is stored in the blob store on job creation time as a 
persistent artifact*
 - *Deployments RPC transmits only the blob storage reference*
 - *TaskManagers retrieve the TaskInfo from the blob cache*
   
   
   ## Verifying this change
   
   Please make sure both new and modified tests in this PR follows the 
conventions defined in our code quality guide: 
https://flink.apache.org/contributing/code-style-and-quality-common.html#testing
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe 
tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
 - *Added integration tests for end-to-end deployment with large payloads 
(100MB)*
 - *Extended integration test for recovery after master (JobManager) 
failure*
 - *Added test that validates that TaskInfo is transferred only once across 
recoveries*
 - *Manually verified the change by running a 4 node cluster with 2 
JobManagers and 4 TaskManagers, a stateful streaming program, and killing one 
JobManager and two TaskManagers during the execution, verifying that recovery 
happens correctly.*
   
   ## 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-unsubscr...@flink.apache.org

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