Skip to content

[Bug] VectorType#isPrunedFrom ignores vector length #8811

Description

@thswlsqls

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version
master @ d3b62af (2.0-SNAPSHOT)

Compute Engine
Engine-agnostic (paimon-api)

Minimal reproduce step
Call DataTypes.VECTOR(3, DataTypes.FLOAT()).isPrunedFrom(DataTypes.VECTOR(5, DataTypes.FLOAT())). VectorType.isPrunedFrom (paimon-api VectorType.java lines 155-167) recurses into the element type but never compares length, so it returns true.

What doesn't meet your expectations?
Two vector types with different lengths are not in a pruning relation. Every other comparison in the class treats length as part of the type identity: equals (line 135), equalsIgnoreFieldId (lines 150-151) and hashCode (line 171) all include it. isPrunedFrom should return false here, mirroring equalsIgnoreFieldId.

Anything else?
The only subset-style override is RowType.isPrunedFrom (field selection). Scalar-parameterized siblings (CharType, DecimalType, TimestampType) inherit DataType.isPrunedFrom, which requires full equality — VectorType is the only type ignoring a scalar parameter. The missing term dates from the commit introducing the type (160a3cd), where the sibling comparison methods already included length.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

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