databend
databend copied to clipboard
bug: explain `estimated rows` is zero when select * from stage
Summary
Count:
mysql> select count() from @lake (pattern => '.*parquet');
+----------+
| count() |
+----------+
| 10000000 |
+----------+
explain:
mysql> explain select * from @lake (pattern => '.*parquet');
+--------------------------------------------------+
| explain |
+--------------------------------------------------+
| TableScan |
| โโโ table: default.system.read_parquet |
| โโโ read rows: 10000000 |
| โโโ read bytes: 1552567904 |
| โโโ partitions total: 9766 |
| โโโ partitions scanned: 9766 |
| โโโ push downs: [filters: [], limit: NONE] |
| โโโ estimated rows: 0.00 |
+--------------------------------------------------+
cc @leiysky @xudong963
The cause is that the StageTable doesn't implement Table::table_statistics.
@dantengsky Is it possible to generate table statistics for stage tables?
@youngsofun is working on it(stage) :)
for parquet๏ผwe can get num rows after read partition