Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3733#discussion_r113043078
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
 ---
    @@ -627,24 +640,27 @@ abstract class TableEnvironment(val config: 
TableConfig) {
         * @param functionName name of the map function. Must not be unique but 
has to be a
         *                     valid Java class identifier.
         */
    -  protected def sinkConversion[T](
    -      physicalRowTypeInfo: TypeInformation[Row],
    +  protected def sinkConversion[T, P](
    --- End diff --
    
    I would refactor this as follows:
    - make `sinkConversion()` an abstract method that is implemented by 
`BatchTableEnvironemnt` and `StreamTableEnvironment`
    - extract the code-generation part that converts a `Row` into the requested 
data type and keep this in a method 
`TableEnvironment.generateRowConverterFunction()`
    - the implementations of `sinkConversion()` can use the 
`generateRowConverterFunction`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to