Skip to content

fix(table): support all Java-comparable types in min/max aggregators - #827

Open
jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:fix/minmax-comparable-types
Open

jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:fix/minmax-comparable-types

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

Java's FieldMinAggFactory and FieldMaxAggFactory accept any type
TypeCheckUtils#isComparable allows, which excludes only MAP, MULTISET, ROW,
ARRAY, VECTOR, VARIANT and BLOB. MinMaxState covered eleven roots and omitted
four that InternalRowUtils#compare handles: BOOLEAN (Boolean.compare),
TIMESTAMP WITH LOCAL TIME ZONE (same branch as TIMESTAMP), BINARY and VARBINARY
(byteArrayCompare). Configuring max on such a column made an aggregation
table unreadable with Aggregate function 'max' does not support data type ....

The four are added. BLOB stays rejected even though Arrow maps it to the same
Binary, and the accumulator now carries the Arrow timezone, read back from
paimon_type_to_arrow so it cannot drift — a result array without it fails
RecordBatch::try_new against the field.

An outdated comment claimed BOOLEAN has no ordering; that test now pins BLOB.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant