Skip to content

Failed to select decimal value with hive when scale in filter is different with hive DDL schema #1699

@qphien

Description

@qphien

Related to issue: #1326

hive (iceberg)> desc decimal_table;
OK
col_name	data_type	comment
val             decimal(7,2)    from deserializer

hive (iceberg)> select * from decimal_table where val > 100.1;
OK
decimal_table.val
Failed with exception java.io.IOException:org.apache.iceberg.exceptions.ValidationException: Invalid value for conversion to type decimal(7, 2): 100.1 (java.math.BigDecimal)

With 100.1 cast as decimal(7, 2), hive still throws the same exception.

hive (iceberg)> select * from decimal_table where val > cast(100.1 as decimal(7,2));
OK
decimal_table.val
Failed with exception java.io.IOException:org.apache.iceberg.exceptions.ValidationException: Invalid value for conversion to type decimal(7, 2): 100.1 (java.math.BigDecimal)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions