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

    https://github.com/apache/flink/pull/2653#discussion_r86649434
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/TableEnvironment.scala
 ---
    @@ -152,21 +153,40 @@ abstract class TableEnvironment(val config: 
TableConfig) {
       protected def getBuiltInRuleSet: RuleSet
     
       /**
    -    * Registers a [[UserDefinedFunction]] under a unique name. Replaces 
already existing
    +    * Registers a [[ScalarFunction]] under a unique name. Replaces already 
existing
         * user-defined functions under this name.
         */
    -  def registerFunction(name: String, function: UserDefinedFunction): Unit 
= {
    -    function match {
    -      case sf: ScalarFunction =>
    -        // register in Table API
    -        functionCatalog.registerFunction(name, function.getClass)
    +  def registerFunction(name: String, function: ScalarFunction): Unit = {
    +    // register in Table API
    +    functionCatalog.registerFunction(name, function.getClass)
     
    -        // register in SQL API
    -        functionCatalog.registerSqlFunction(sf.getSqlFunction(name, 
typeFactory))
    +    // register in SQL API
    +    functionCatalog.registerSqlFunction(function.getSqlFunction(name, 
typeFactory))
    --- End diff --
    
    "At here, function.getSqlFunction (name, typeFactory)" the "name" is user 
input,but at ScalarFunctionCall I see "scalarFunction.getSqlFunction 
(scalarFunction.toString, typeFactory)", which may not be we expect Right? 


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