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

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

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

    https://github.com/apache/flink/pull/2870#discussion_r103734557
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/codegen/calls/ScalarOperators.scala
 ---
    @@ -1002,12 +1068,17 @@ object ScalarOperators {
         val resultTypeTerm = primitiveTypeTermForTypeInfo(resultType)
         // no casting necessary
         if (operandType == resultType) {
    -      (operandTerm) => s"$operandTerm"
    +      if (isDecimal(operandType)) {
    +        (operandTerm) => s"$operandTerm.stripTrailingZeros()"
    --- End diff --
    
    @twalthr I continue work of @NickolayVasilishin and found In 
5WD-01-Framework-2003-09.pdf (SQL:2003 standard) following text:
    
    > There are two classes of numeric type: exact numeric, which includes 
integer types and types with specified
    precision and scale; and approximate numeric, which is essentially floating 
point, and for which a precision
    may optionally be specified.
    Every number has a precision (number of digits), and exact numeric types 
also have a scale (digits after the
    radix point). Arithmetic operations may be performed on operands of 
different or the same numeric type, and
    the result is of a numeric type that depends only on the numeric type of 
the operands. If the result cannot be
    represented exactly in the result type, then whether it is rounded or 
truncated is implementation-defined. An
    exception condition is raised if the result is outside the range of numeric 
values of the result type, or if the
    arithmetic operation is not defined for the operands.
    
    <BigDecimal> can has different <MathContext> and different scale, precision 
and rounding modes. 
    I think, in case of <BigDecimal> we have to strip trailing zeros to avoid 
possible problem with parsing of <BigDecimal> value from strings
    
    BTW, standard do not says that 2.00 can be unequal to 2


> Support for SQL IN operator
> ---------------------------
>
>                 Key: FLINK-4565
>                 URL: https://issues.apache.org/jira/browse/FLINK-4565
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>            Reporter: Timo Walther
>            Assignee: Dmytro Shkvyra
>
> It seems that Flink SQL supports the uncorrelated sub-query IN operator. But 
> it should also be available in the Table API and tested.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to