Skip to content

ArrowUtils.toAttributeType collapses non-{16,32}-bit Int widths to LONG #4760

@Yicong-Huang

Description

@Yicong-Huang

What happened?

common/workflow-core/src/main/scala/org/apache/texera/amber/util/ArrowUtils.scala::toAttributeType matches case 16 | 32 => INTEGER then case 64 | _ => LONG. The trailing _ makes the second arm a catch-all, so every Int width that isn't 16 or 32 — including widths smaller than 32 like 8, and widths larger than 64 like 128 — surfaces as LONG. The intent of the second arm appears to have been "true 64-bit Int → LONG", and the _ was redundantly added; the side effect is that exotic widths silently coerce to LONG with no warning.

How to reproduce?

import org.apache.arrow.vector.types.pojo.ArrowType
import org.apache.texera.amber.util.ArrowUtils

ArrowUtils.toAttributeType(new ArrowType.Int(8, true))   // LONG (probably should be INTEGER or fail)
ArrowUtils.toAttributeType(new ArrowType.Int(64, true))  // LONG
ArrowUtils.toAttributeType(new ArrowType.Int(128, true)) // LONG (probably should fail)

Version

1.1.0-incubating (Pre-release/Master)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions