beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Work logged] (BEAM-2281) call SqlFunctions in operator implementation
Date Wed, 14 Mar 2018 00:04:00 GMT


ASF GitHub Bot logged work on BEAM-2281:

                Author: ASF GitHub Bot
            Created on: 14/Mar/18 00:03
            Start Date: 14/Mar/18 00:03
    Worklog Time Spent: 10m 
      Work Description: akedin commented on a change in pull request #4865: [BEAM-2281][Sql]
Use SqlFunctions.toBigDecimal not toString

 File path: sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/interpreter/operator/arithmetic/
 @@ -53,10 +54,8 @@ protected BeamSqlArithmeticExpression(List<BeamSqlExpression> operands,
   @Override public BeamSqlPrimitive<? extends Number> evaluate(Row inputRow,
       BoundedWindow window) {
-    BigDecimal left = BigDecimal.valueOf(
-        Double.valueOf(opValueEvaluated(0, inputRow, window).toString()));
-    BigDecimal right = BigDecimal.valueOf(
-        Double.valueOf(opValueEvaluated(1, inputRow, window).toString()));
+    BigDecimal left = SqlFunctions.toBigDecimal((Number) opValueEvaluated(0, inputRow, window));
 Review comment:
   Why not use the [`toBigDecimal(Object)`](

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:

Issue Time Tracking

    Worklog Id:     (was: 80149)
    Time Spent: 0.5h  (was: 20m)

> call SqlFunctions in operator implementation
> --------------------------------------------
>                 Key: BEAM-2281
>                 URL:
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql
>            Reporter: Xu Mingmin
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
> Calcite has a collections of functions in {{org.apache.calcite.runtime.SqlFunctions}}.
It sounds a good source to leverage when adding operators as {{BeamSqlExpression}}. 
> [~xumingming] [~app-tarush], any comments?

This message was sent by Atlassian JIRA

View raw message