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

ASF GitHub Bot commented on TAJO-1092:
--------------------------------------

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

    https://github.com/apache/tajo/pull/178#discussion_r18773411
  
    --- Diff: 
tajo-core/src/main/java/org/apache/tajo/engine/function/math/MathFunctions.java 
---
    @@ -0,0 +1,46 @@
    +/***
    + * 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.tajo.engine.function.math;
    +
    +import org.apache.tajo.function.FunctionCollection;
    +import org.apache.tajo.function.ScalarFunction;
    +
    +import static org.apache.tajo.common.TajoDataTypes.Type.FLOAT8;
    +
    +@FunctionCollection
    +public class MathFunctions {
    +
    +  @ScalarFunction(name = "pi", returnType = FLOAT8)
    +  public static double pi() {
    +    return Math.PI;
    +  }
    +
    +  @ScalarFunction(name = "pow", returnType = FLOAT8, paramTypes = {FLOAT8, 
FLOAT8})
    +  public static Double pow(Double x, Double y) {
    +    if (x == null || y == null) {
    +      return null;
    +    }
    +    return Math.pow(x, y);
    +  }
    +
    +//  @ScalarFunction(name = "pow", returnType = FLOAT8, paramTypes = 
{FLOAT8, FLOAT8})
    --- End diff --
    
     Please remove the commented out line.


> Improve the function system to allow other function implementation types
> ------------------------------------------------------------------------
>
>                 Key: TAJO-1092
>                 URL: https://issues.apache.org/jira/browse/TAJO-1092
>             Project: Tajo
>          Issue Type: Improvement
>          Components: function/udf
>            Reporter: Hyunsik Choi
>            Assignee: Hyunsik Choi
>             Fix For: 0.9.1, block_iteration
>
>
> In the current function system, each function implementation is a single Java 
> class subclassed from org.apache.tajo.catalog.function.Function. 
> In this approach, there are many rooms for improvement. This approach always 
> uses Datum as input and output values of functions, creating unnecessary 
> objects. It does not likely to exploit given information included query 
> statements; for example, some parameters are constants or variables.
> In this issue, I propose the improvement to allow the function system to 
> support other function implementation types. In addition, I propose three 
> function implementation types:
> - legacy Java class function provided by the current Tajo
> - static method in Java class
> - code generation by ASM
> Later, we could expand this feature to allow Pig or Hive functions in Tajo.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to