Skip to content

Commit 61bb8c2

Browse files
nokiaMSgithubgxll
authored andcommitted
[fix][core] Support tinyint to decimal in div operator.
1 parent 64c0711 commit 61bb8c2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,15 @@ public static boolean isInt(RelDataType type) {
523523
return typeName == SqlTypeName.INTEGER;
524524
}
525525

526+
/** Returns whether a type is TINYINT. */
527+
public static boolean isTinyint(RelDataType type) {
528+
SqlTypeName typeName = type.getSqlTypeName();
529+
if (typeName == null) {
530+
return false;
531+
}
532+
return typeName == SqlTypeName.TINYINT;
533+
}
534+
526535
/** Returns whether a type is numeric with exact precision. */
527536
public static boolean isExactNumeric(RelDataType type) {
528537
SqlTypeName typeName = type.getSqlTypeName();

0 commit comments

Comments
 (0)