Skip to content

Negative-scale decimal cast to timestamp panics #7002

Open

Description

@Ersa-tech

With spark.sql.legacy.allowNegativeScaleOfDecimal=true, CAST(CAST(c * 1E2 AS TIMESTAMP) AS LONG) returns -45600, 0, 12300 in Spark. Comet panics in 10_i128.pow(scale as u32) with attempt to exponentiate with overflow. CometCast.canCastFromDecimal reports the cast as compatible for any scale. The decimal-to-string path already checks that setting.

This predates and is unchanged by #6969; found in review there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions