Skip to content

try_divide function does not accept floating point numbers only integers #2198

Description

@canimus

Function try_divide does not accept floating point numbers:

spark.sql("select try_divide(10.0, 2.2)").show()

ERROR:

AnalysisException: Execution error: Function 'try_divide' user-defined coercion failed with: Execution error: Unsupported Data Type: Spark `try_divide` function expects Int32, Int64 o Interval(YearMonth) / Int32, got Decimal128(3, 1), Decimal128(2, 1). No function matches the given name and argument types 'try_divide(Decimal128(3, 1), Decimal128(2, 1))'. You might need to add explicit type casts.
        Candidate functions:
        try_divide(UserDefined)

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