Skip to content

DecimalLiteral.to(LongType) returns IntAboveMax instead of LongAboveMax #3469

@abnobdoss

Description

@abnobdoss

Apache Iceberg version

0.11.0 (latest release)

Please describe the bug 🐞

DecimalLiteral.to(LongType) returns IntAboveMax()/IntBelowMin() instead of LongAboveMax()/LongBelowMin(). Looks like it was copied from the IntegerType handler without updating the sentinel types.

from decimal import Decimal
from pyiceberg.expressions.literals import DecimalLiteral
from pyiceberg.types import LongType

lit = DecimalLiteral(Decimal("99999999999999999999"))
result = lit.to(LongType())

print(type(result).__name__)
# Actual:   IntAboveMax
# Expected: LongAboveMax

StringLiteral.to(LongType) correctly uses LongAboveMax/LongBelowMin for the same check.

Affected lines: expressions/literals.py:522 and :524

Fix: IntAboveMax()LongAboveMax(), IntBelowMin()LongBelowMin()

Willingness to contribute

  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions