Zoltán Borók-Nagy created IMPALA-15796:
------------------------------------------

             Summary: Impala drops empty string bounds from the metrics of 
Iceberg data files
                 Key: IMPALA-15796
                 URL: https://issues.apache.org/jira/browse/IMPALA-15796
             Project: IMPALA
          Issue Type: Bug
          Components: Catalog
            Reporter: Zoltán Borók-Nagy


{{IcebergCatalogOpExecutor.buildDataFileMetrics()}} only keeps lower and upper 
bounds that are longer than 0 bytes, so it drops the bound of an empty STRING 
or BINARY value. Iceberg stores such a bound as an empty buffer.

Without the lower bound, Iceberg can't skip a file for {{IN}} or {{LIKE 
'abc%'}} (startsWith). E.g. it reads a file with the values '' and 'b' for {{s 
IN ('c')}} and {{s LIKE 'c%'}}. If every non-null value is empty, both bounds 
are missing, so it can't skip the file for e.g. {{s = 'abc'}} either. The 
results are correct, only the pruning is lost.

{code:sql}
create table empty_t (s string) stored as iceberg;
insert into empty_t values (''), ('');
select lower_bounds, upper_bounds, value_counts from empty_t.`files`;
-- {}  {}  {1:2}
-- expected the empty string as both bounds
{code}

Found while comparing the Iceberg metrics written by master (19731aa580) with 
Iceberg 1.11.0.

---------------------------------------------------------------------------------------------



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to