[CALCITE-7624] Support BigDecimal for FETCH and OFFSET in Enumerable#5050
[CALCITE-7624] Support BigDecimal for FETCH and OFFSET in Enumerable#5050tkalkirill wants to merge 1 commit into
Conversation
|
@xiedeyantu Can you take a look?
Of course, I could create a task for each question and resolve them there. Is that standard practice, or should I address them via the dev list first? |
|
|
In general we should push as much as possible in the validation and code generation layers. |
|
@tkalkirill Thanks for spinning this feature out into a separate piece of work! For the first point, I agree with Mihai’s suggestion—we should intercept invalid formats as early as possible in the pre-processing logic, and we can also refer to how errors are gracefully handled in the existing execution flow. This would also serve as good groundwork for your earlier PR. For the second point, I think we should add something similar to what you implemented in your previous PR. I’m wondering whether we should deprecate the old approach and support only BigDecimal going forward? This might be worth continuing to discuss in the Jira ticket. On the third point, I also agree with Mihai. We could consider following PostgreSQL’s behavior, since Calcite often takes Postgres as a reference first; if Postgres doesn’t support something, then other mainstream implementations are considered. That said, if you believe another approach is more reasonable, as long as we document the rationale clearly where needed, that should be acceptable. For the fourth point, I do think it makes sense to allow updates. Regarding the fifth point, I personally feel we should unify the behavior—widening the type shouldn’t break compatibility. On the sixth point, for adapters, I think we could either apply different validation logic per backend or let each backend handle its own checks. Both options seem reasonable to me; let’s see if others have better ideas. If not, as long as we provide accurate documentation, that should be fine. |



Jira Link
CALCITE-7624
Changes Proposed
This PR proposes using BigDecimal for FETCH and OFFSET, so that the following SQL queries work: