Thank you very much for your feedback!
Search before asking
Fluss version
main (development)
Please describe the bug 馃悶
What happened
When a Flink Batch job reads a Fluss Log Table with column statistics enabled, and the query predicate filters out all records in a bucket, the query returns no records but the Flink job remains in the RUNNING state.
The bounded batch read does not complete.
What I expected
The query should return an empty result, and the Flink Batch job should finish normally.
Steps to reproduce
Start Fluss and Flink, then run the following scenario:
-
Configure Flink to use batch mode with low parallelism:
SET 'execution.runtime-mode' = 'batch';
SET 'parallelism.default' = '1';
-
Create a Log Table with two buckets and statistics enabled for amount:
CREATE TABLE stats_log (
order_id BIGINT,
amount INT
) WITH (
'bucket.num' = '2',
'table.statistics.columns' = 'amount'
);
-
Write two records with positive values and ensure that the records are distributed across the two buckets, for example:
-
Run a query that matches no records:
SELECT *
FROM stats_log
WHERE amount < 0;
-
Observe the result and the Flink job state.
-
Remove the table.statistics.columns configuration and repeat the same query with the same data as a control test.
Additional context
With table.statistics.columns = 'amount' enabled, the query returns no records, but the Flink job remains in the RUNNING state. Without this configuration, the same query returns Empty set and finishes normally.
Column statistics allow Fluss to skip batches that cannot match the predicate, returning no records while still advancing the consumed offset to the end. The Flink source reader checks split completion only from the last materialized record and ignores this progress-only result, so the split is never completed.
Solution
Use the consumed offset progress to determine whether a bounded split has reached its stopping offset, including when the scan returns no materialized records.
Are you willing to submit a PR?
Thank you very much for your feedback!
Search before asking
Fluss version
main (development)Please describe the bug 馃悶
What happened
When a Flink Batch job reads a Fluss Log Table with column statistics enabled, and the query predicate filters out all records in a bucket, the query returns no records but the Flink job remains in the
RUNNINGstate.The bounded batch read does not complete.
What I expected
The query should return an empty result, and the Flink Batch job should finish normally.
Steps to reproduce
Start Fluss and Flink, then run the following scenario:
Configure Flink to use batch mode with low parallelism:
Create a Log Table with two buckets and statistics enabled for
amount:Write two records with positive values and ensure that the records are distributed across the two buckets, for example:
Run a query that matches no records:
Observe the result and the Flink job state.
Remove the
table.statistics.columnsconfiguration and repeat the same query with the same data as a control test.Additional context
With
table.statistics.columns = 'amount'enabled, the query returns no records, but the Flink job remains in theRUNNINGstate. Without this configuration, the same query returnsEmpty setand finishes normally.Column statistics allow Fluss to skip batches that cannot match the predicate, returning no records while still advancing the consumed offset to the end. The Flink source reader checks split completion only from the last materialized record and ignores this progress-only result, so the split is never completed.
Solution
Use the consumed offset progress to determine whether a bounded split has reached its stopping offset, including when the scan returns no materialized records.
Are you willing to submit a PR?