[ 
https://issues.apache.org/jira/browse/BEAM-5852?focusedWorklogId=161339&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-161339
 ]

ASF GitHub Bot logged work on BEAM-5852:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Oct/18 21:45
            Start Date: 31/Oct/18 21:45
    Worklog Time Spent: 10m 
      Work Description: akedin commented on a change in pull request #6898: 
[BEAM-5852] [BEAM-5892] BeamSQL functions
URL: https://github.com/apache/beam/pull/6898#discussion_r229863229
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/udf/IsNan.java
 ##########
 @@ -0,0 +1,50 @@
+/*
+ * 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.beam.sdk.extensions.sql.impl.udf;
+
+import com.google.auto.service.AutoService;
+
+/**
+ * IS_NAN(X)
+ *
+ * <p>Returns TRUE if the value is a NaN value. Returns NULL for NULL inputs. 
input: Float, Double
+ *
+ * <p>Output: Boolean
+ */
+@AutoService(BeamBuiltinFunctionClass.class)
+public class IsNan implements BeamBuiltinFunctionClass {
+  private static final String SQL_FUNCTION_NAME = "IS_NAN";
+
+  @UserDefinedFunctionAnnotation(
+    funcName = SQL_FUNCTION_NAME,
+    parameterArray = {Float.class},
+    returnType = Boolean.class
+  )
+  public Boolean isNan(Float value) {
+    return Float.isNaN(value);
+  }
+
+  @UserDefinedFunctionAnnotation(
 
 Review comment:
   `@UserDefinedFunction` should work as is. I would change it to `@UDF`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 161339)
    Time Spent: 1h 20m  (was: 1h 10m)

> Function extension in BeamSQL
> -----------------------------
>
>                 Key: BEAM-5852
>                 URL: https://issues.apache.org/jira/browse/BEAM-5852
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> We could add more functions to BeamSQL (as UDFs) to provide rich 
> functionalities than standard/Calcite functions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to