本文整理了Java中org.apache.calcite.rex.RexBuilder.encodeIntervalOrDecimal
方法的一些代码示例,展示了RexBuilder.encodeIntervalOrDecimal
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RexBuilder.encodeIntervalOrDecimal
方法的具体详情如下:
包路径:org.apache.calcite.rex.RexBuilder
类名称:RexBuilder
方法名:encodeIntervalOrDecimal
[英]Casts a decimal's integer representation to a decimal node. If the expression is not the expected integer type, then it is casted first.
An overflow check may be requested to ensure the internal value does not exceed the maximum value of the decimal type.
[中]将十进制的整数表示形式强制转换为十进制节点。如果表达式不是预期的整数类型,则首先将其强制转换。
可能需要进行溢出检查,以确保内部值不超过十进制类型的最大值。
代码示例来源:origin: org.apache.calcite/calcite-core
/**
* Casts a decimal's integer representation to a decimal node. If the
* expression is not the expected integer type, then it is casted first.
*
* <p>An overflow check may be requested to ensure the internal value
* does not exceed the maximum value of the decimal type.
*
* @param value integer representation of decimal
* @param decimalType type integer will be reinterpreted as
* @param checkOverflow indicates whether an overflow check is required
* when reinterpreting this particular value as the
* decimal type. A check usually not required for
* arithmetic, but is often required for rounding and
* explicit casts.
* @return the integer reinterpreted as an opaque decimal type
*/
protected RexNode encodeValue(
RexNode value,
RelDataType decimalType,
boolean checkOverflow) {
return builder.encodeIntervalOrDecimal(
value, decimalType, checkOverflow);
}
代码示例来源:origin: Qihoo360/Quicksql
/**
* Casts a decimal's integer representation to a decimal node. If the
* expression is not the expected integer type, then it is casted first.
*
* <p>An overflow check may be requested to ensure the internal value
* does not exceed the maximum value of the decimal type.
*
* @param value integer representation of decimal
* @param decimalType type integer will be reinterpreted as
* @param checkOverflow indicates whether an overflow check is required
* when reinterpreting this particular value as the
* decimal type. A check usually not required for
* arithmetic, but is often required for rounding and
* explicit casts.
* @return the integer reinterpreted as an opaque decimal type
*/
protected RexNode encodeValue(
RexNode value,
RelDataType decimalType,
boolean checkOverflow) {
return builder.encodeIntervalOrDecimal(
value, decimalType, checkOverflow);
}
内容来源于网络,如有侵权,请联系作者删除!