[
https://issues.apache.org/jira/browse/CALCITE-7346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Zhen Chen resolved CALCITE-7346.
--------------------------------
Fix Version/s: 1.42.0
Assignee: Zhen Chen
Resolution: Fixed
Fixed in
[{{c274aac}}|https://github.com/apache/calcite/commit/c274aacdfd2d0edc9a7184765c327fd8d35e666d]
Thanks for review and discussion [~mbudiu] [~asolimando]
> Prevent overflow in metadata row-count when LIMIT/OFFSET literal exceeds Long
> range
> -----------------------------------------------------------------------------------
>
> Key: CALCITE-7346
> URL: https://issues.apache.org/jira/browse/CALCITE-7346
> Project: Calcite
> Issue Type: Improvement
> Reporter: Zhen Chen
> Assignee: Zhen Chen
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.42.0
>
>
> Currently, the implementations of RelMdRowCount, RelMdMaxRowCount, and
> RelMdMinRowCount all use RexLiteral.longValue() when dealing with
> LIMIT/OFFSET. If the literal value of the LIMIT/OFFSET exceeds the range of
> Long, an overflow error will occur. Ideally, this would be changed to
> BigDecimal, but considering that structures like mq.getRowCount() return
> Double, we can continue using Double. This value is sufficient for most
> databases. As far as I know, ClickHouse currently supports a maximum of
> UInt64. I don't know if there are any databases that support larger values.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)