flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-9688) ATAN2 Sql Function support
Date Mon, 02 Jul 2018 00:02:00 GMT

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

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

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

    https://github.com/apache/flink/pull/6223#discussion_r199365966
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/ScalarFunctionsTest.scala
---
    @@ -1111,6 +1111,53 @@ class ScalarFunctionsTest extends ScalarTypesTestBase {
           math.atan(-0.1231231321321321111).toString)
       }
     
    +  @Test
    +  def testAtan2(): Unit = {
    +    testAllApis(
    +      'f25.atan2('f26),
    +      "f25.atan2(f26)",
    +      "ATAN2(f25, f26)",
    +      math.atan2(0.42.toByte, 0.toByte).toString)
    +
    +
    --- End diff --
    
    Remove this blank line would be better~ 


> ATAN2 Sql Function support
> --------------------------
>
>                 Key: FLINK-9688
>                 URL: https://issues.apache.org/jira/browse/FLINK-9688
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API &amp; SQL
>            Reporter: Sergey Nuyanzin
>            Assignee: Sergey Nuyanzin
>            Priority: Minor
>              Labels: pull-request-available
>
> simple query fails {code}
> ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
> BatchTableEnvironment tableEnv = TableEnvironment.getTableEnvironment(env, config());
> DataSet<Tuple3<Integer, Long, String>> ds = CollectionDataSets.get3TupleDataSet(env);
> tableEnv.registerDataSet("t1", ds, "x, y, z");
> String sqlQuery = "SELECT atan2(1,2)";
> Table result = tableEnv.sqlQuery(sqlQuery);
> {code}
> while at the same time Calcite supports it and in Calcite's sqlline it works like {noformat}
> 0: jdbc:calcite:model=target/test-classes/mod> select atan2(1,2);
> +-----------------+
> |     EXPR$0      |
> +-----------------+
> | 0.4636476090008061 |
> +-----------------+
> 1 row selected (0.173 seconds)
> {noformat}



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

Mime
View raw message