Skip to content

Commit

Permalink
add int16 to int32 and float32 cast
Browse files Browse the repository at this point in the history
  • Loading branch information
aalkin committed Aug 9, 2024
1 parent a798984 commit ef5368c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cpp/src/gandiva/function_registry_arithmetic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ std::vector<NativeFunction> GetArithmeticFunctionRegistry() {
UNARY_SAFE_NULL_IF_NULL(not, {}, boolean, boolean),
UNARY_SAFE_NULL_IF_NULL(castBIGINT, {}, int32, int64),
UNARY_SAFE_NULL_IF_NULL(castINT, {}, int64, int32),
UNARY_SAFE_NULL_IF_NULL(castINT, {}, int16, int32),
UNARY_SAFE_NULL_IF_NULL(castINT, {}, int8, int32),
UNARY_SAFE_NULL_IF_NULL(castBIGINT, {}, decimal128, int64),

// cast to float32
UNARY_CAST_TO_FLOAT32(int32), UNARY_CAST_TO_FLOAT32(int64),
UNARY_CAST_TO_FLOAT32(float64), UNARY_CAST_TO_FLOAT32(int8),
UNARY_CAST_TO_FLOAT32(int8), UNARY_CAST_TO_FLOAT32(int16),
UNARY_CAST_TO_FLOAT33(int64), UNARY_CAST_TO_FLOAT32(float64),
UNARY_CAST_TO_FLOAT32(int32),

// cast to int32
UNARY_CAST_TO_INT32(float32), UNARY_CAST_TO_INT32(float64),
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/gandiva/precompiled/arithmetic_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ NUMERIC_DATE_TYPES(COMPARE_SIX_VALUES, least, <)
CAST_UNARY(castBIGINT, int32, int64)
CAST_UNARY(castINT, int64, int32)
CAST_UNARY(castINT, int8, int32)
CAST_UNARY(castINT, int16, int32)
CAST_UNARY(castFLOAT4, int8, float32)
CAST_UNARY(castFLOAT4, int16, float32)
CAST_UNARY(castFLOAT4, int32, float32)
CAST_UNARY(castFLOAT4, int64, float32)
CAST_UNARY(castFLOAT8, int32, float64)
Expand Down

0 comments on commit ef5368c

Please sign in to comment.