Hi Denys,

>From my testing, your query works okay in Beeline, but the log of both
HiveServer2 and Metastore still prints NullPointerException when 'analyze
table ... for columns ...' is executed.

25/12/13 09:46:42 INFO stats.BasicStatsTask: [Warning] could not update
stats.Failed with exception Unable to alter partition.
java.lang.NullPointerException: Cannot invoke "java.util.List.size()"
because "vals" is null

It is only a [Warning] message, but it seems like the stats are not
properly updated in Metastore or in Iceberg Puffin files (depending on the
value of hive.iceberg.stats.source).

I already opened a JIRA ticket:

https://issues.apache.org/jira/browse/HIVE-29361

Could you check your log file and find the same warning message? Thank you.

Regards,
---  Sungwoo

On Sat, Dec 13, 2025 at 5:52 PM Denys Kuzmenko <[email protected]> wrote:

> below test-case works as expected:
>
> create external table src_ice(
>     a int,
>     b string,
>     c int
> )
> stored by iceberg;
>
> insert into src_ice values
>     (1, 'one', 50),
>     (2, 'two', 51),
>     (2, 'two', 51),
>     (2, 'two', 51),
>     (3, 'three', 52),
>     (4, 'four', 53),
>     (5, 'five', 54),
>     (111, 'one', 55),
>     (333, 'two', 56);
>
> create external table tbl_ice(
>     a int,
>     b string
> )
> partitioned by (c int)
> stored by iceberg;
>
> insert overwrite table tbl_ice select * from src_ice;
> delete from tbl_ice where a <= 2;
>
> analyze table tbl_ice compute statistics for columns A, C;
> explain select min(a), max(c) from tbl_ice;
> select count(*) from tbl_ice;
> desc formatted tbl_ice C;
>

Reply via email to