You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "aykut-bozkurt (via GitHub)" <gi...@apache.org> on 2025/05/20 13:16:19 UTC
[I] Iceberg Truncate Transform Wrong Result due to Integer Overflow [iceberg]
aykut-bozkurt opened a new issue, #13105:
URL: https://github.com/apache/iceberg/issues/13105
### Apache Iceberg version
1.9.0 (latest release)
### Query engine
Spark
### Please describe the bug 🐞
I get wrong results when I apply truncate transform on bigint type via pyspark sql api. It seems like an overflow issue with truncate transform. (can repro without iceberg as well)
Steps to repro:
```py
> spark.sql("""CREATE TABLE prod.db.sample (a bigint) using iceberg partitioned by (truncate(10,a));""")
DataFrame[]
> spark.sql("""insert into prod.db.sample values(-9223372036854775808);""")
DataFrame[]
# wrong result due to overflow
> spark.sql(f"select * from prod.db.sample where a < 0").collect()
[]
# partition value overflow
> spark.sql("select partition.* from prod.db.sample.files").collect()
[Row(a_trunc=9223372036854775806)]
```
### Willingness to contribute
- [ ] I can contribute a fix for this bug independently
- [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [x] I cannot contribute a fix for this bug at this time
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Iceberg Truncate Transform Wrong Result due to Integer Overflow [iceberg]
Posted by "nandorKollar (via GitHub)" <gi...@apache.org>.
nandorKollar commented on issue #13105:
URL: https://github.com/apache/iceberg/issues/13105#issuecomment-2898072210
I think this would possibly require a spec change. I'm afraid that both over and underflows are possible, overflows might be addressed if spec would use `v - (v % W) `for positive values instead of `v - (((v % W) + W) % W)`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Iceberg Truncate Transform Wrong Result due to Integer Overflow [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #13105:
URL: https://github.com/apache/iceberg/issues/13105#issuecomment-3599547374
This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Iceberg Truncate Transform Wrong Result due to Integer Overflow [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #13105: Iceberg Truncate Transform Wrong Result due to Integer Overflow
URL: https://github.com/apache/iceberg/issues/13105
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] Iceberg Truncate Transform Wrong Result due to Integer Overflow [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #13105:
URL: https://github.com/apache/iceberg/issues/13105#issuecomment-3544430563
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org