| 1743 | } |
| 1744 | |
| 1745 | static inline bool tryCombineDecimalTypes(const LogicalType& left, const LogicalType& right, |
| 1746 | LogicalType& result) { |
| 1747 | auto precisionLeft = DecimalType::getPrecision(left); |
| 1748 | auto scaleLeft = DecimalType::getScale(left); |
| 1749 | auto precisionRight = DecimalType::getPrecision(right); |
| 1750 | auto scaleRight = DecimalType::getScale(right); |
| 1751 | auto resultingScale = std::max(scaleLeft, scaleRight); |
| 1752 | auto resultingPrecision = |
| 1753 | std::max(precisionLeft - scaleLeft, precisionRight - scaleRight) + resultingScale; |
| 1754 | if (resultingPrecision > DECIMAL_PRECISION_LIMIT) { |
| 1755 | result = LogicalType::DOUBLE(); |
| 1756 | return true; |
| 1757 | } |
| 1758 | result = LogicalType::DECIMAL(resultingPrecision, resultingScale); |
| 1759 | return true; |
| 1760 | } |
| 1761 | |
| 1762 | static inline bool tryCombineDecimalWithNumeric(const LogicalType& dec, const LogicalType& nonDec, |
| 1763 | LogicalType& result) { |
no outgoing calls
no test coverage detected