[ 
https://issues.apache.org/jira/browse/FLINK-6960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16057589#comment-16057589
 ] 

ASF GitHub Bot commented on FLINK-6960:
---------------------------------------

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?


> Add E(2.7182818284590452354),PI(3.14159265358979323846) supported in SQL
> ------------------------------------------------------------------------
>
>                 Key: FLINK-6960
>                 URL: https://issues.apache.org/jira/browse/FLINK-6960
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>            Reporter: sunjincheng
>            Assignee: sunjincheng
>              Labels: starter
>
> E=Math.E 
> PI=Math.PI



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to