Skip to content

[C++][Gandiva] A question about Gandiva's GetResultType for DecimalType #40308

@ZhangHuiGui

Description

@ZhangHuiGui

Describe the bug, including details regarding any error messages, version, and platform.

Below codes calculate the decimal type's precision and scale.

result_scale = std::max(kMinAdjustedScale, s1 + p2 + 1);

It seems different from our Redshift’s decimal promotion rules, is there any relevant background here?

scale = max(4, s1 + p2 - s2 + 1)
precision = p1 - s1 + s2 + scale

It may cause the decimal divide results different from normal expression calculate.

Component(s)

C++ - Gandiva

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions