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

    https://github.com/apache/flink/pull/4152#discussion_r123261877
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/scalarSqlFunctions/MathSqlFunctions.scala
 ---
    @@ -0,0 +1,35 @@
    +/*
    + * 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.functions.scalarSqlFunctions
    +
    +import org.apache.calcite.sql.{SqlFunction, SqlFunctionCategory, SqlKind}
    +import org.apache.calcite.sql.`type`._
    +
    +class MathSqlFunctions {
    +
    +}
    +
    +object MathSqlFunctions {
    +  val E = new SqlFunction(
    --- End diff --
    
    I notice this class, I have not using this because:
    1. The constructor of `SqlBaseContextVariable` is protected.
    2. I think called the scalar function with "()" is make sense. 
    
    About the folder, at the point of my view,  Build-in scalar function in 
flink will need two part:
    1. `SqlFuncitons` which are define the interface of scalar function for 
`FunctionGenerator` and `FunctionCatalog`.
    2. `Runtime implementation` which are the real logic of scalar function. 
using in `BuiltInMethods`.
    
    So, I want create two packages: 
`org.apache.flink.table.functions.scalarSqlFunctions` and 
`org.apache.flink.table.runtime.scalarfunctions`(in this PR not need the 
runtime package). 
    Please let me know What do you think?


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