iceberg icon indicating copy to clipboard operation
iceberg copied to clipboard

numBuckets can cause division by zero

Open gaborkaszab opened this issue 4 years ago • 3 comments

The numBuckets member in Bucket class is not verified and I managed to create a table with a Bucket partition with zero buckets. This later could cause an exception due to modulo by zero here: https://github.com/apache/iceberg/blob/c28d1c8ba6322af07f0206c4cf3fdad875f37ac1/api/src/main/java/org/apache/iceberg/transforms/Bucket.java#L87

gaborkaszab avatar Oct 01 '20 13:10 gaborkaszab

We can do some validation on the input parameters when creating the bucket partition.

zhangdove avatar Oct 09 '20 06:10 zhangdove

It seems that some time has passed and there is no reply. I would provide a relevant PR to fix this small problem.

zhangdove avatar Oct 09 '20 06:10 zhangdove

This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.

github-actions[bot] avatar Feb 27 '24 00:02 github-actions[bot]

This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'

github-actions[bot] avatar Mar 13 '24 00:03 github-actions[bot]