Skip to content

Incorrect min/max statistics for decimals with byte-array notation #1532

@atefsawaed

Description

@atefsawaed

Describe the bug
When dealing with decimals built with byte-array notation, the min/max comparison should be based on the logical type and not on the physical type.
Integers that are provided as converted types and without specifying the logical type, unsigned comparison should be applied.

To Reproduce

  1. Decimals with byte-array notation:
    a. Create a decimal column (as logical type) with a fixed length byte array type.
    b. Write the following values to the column: [2.11, 3.22, 4.33, -5.44]
  2. Integers specified using the converted type only (No logical type provided):
    a. Create an integer column (as converted type) with an unsigned int physical type.
    b. Write the following values to the column: [1, 2, 3, -1]

Expected behavior

  1. Reading the statistics of the first row group in the column with the decimal type:
    Expected: min=-5.44, max=4.33
    Actual: min=2.11, max=-5.44
  2. Reading the statistics of the first row group in the column with the integer:
    Expected: min=-1, max=3
    Actual: min=1, max=-1

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions