Skip to content

Commit a579ebf

Browse files
xuechendizhouyuan
authored andcommitted
[oap-native-sql] Add castInt(int8) (#89)
Signed-off-by: Chendi Xue <chendi.xue@intel.com>
1 parent 323e155 commit a579ebf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cpp/src/gandiva/function_registry_arithmetic.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ std::vector<NativeFunction> GetArithmeticFunctionRegistry() {
4040
UNARY_SAFE_NULL_IF_NULL(castBIGINT, {}, float32, int64),
4141
UNARY_SAFE_NULL_IF_NULL(castBIGINT, {}, float64, int64),
4242
UNARY_SAFE_NULL_IF_NULL(castBIGINT, {}, date64, int64),
43+
UNARY_SAFE_NULL_IF_NULL(castINT, {}, int8, int32),
4344
UNARY_SAFE_NULL_IF_NULL(castINT, {}, int64, int32),
4445
UNARY_SAFE_NULL_IF_NULL(castINT, {}, date32, int32),
4546
UNARY_SAFE_NULL_IF_NULL(castINT, {}, float32, int32),

cpp/src/gandiva/precompiled/arithmetic_ops.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ CAST_UNARY(castBIGINT, int32, int64)
118118
CAST_UNARY(castBIGINT, date64, int64)
119119
CAST_UNARY(castBIGINT, float32, int64)
120120
CAST_UNARY(castBIGINT, float64, int64)
121+
CAST_UNARY(castINT, int8, int32)
121122
CAST_UNARY(castINT, int64, int32)
122123
CAST_UNARY(castINT, date32, int32)
123124
CAST_UNARY(castINT, float32, int32)
@@ -309,10 +310,10 @@ SHIFT_LEFT_INT(int64, int32)
309310

310311
#undef SHIFT_RIGHT_INT
311312

312-
#define SHIFT_RIGHT_INT(LTYPE, RTYPE) \
313-
FORCE_INLINE \
314-
gdv_##LTYPE shift_right_##LTYPE##_##RTYPE(gdv_##LTYPE in1, gdv_##RTYPE in2) { \
315-
return static_cast<gdv_##LTYPE>(in1 >> in2); \
313+
#define SHIFT_RIGHT_INT(LTYPE, RTYPE) \
314+
FORCE_INLINE \
315+
gdv_##LTYPE shift_right_##LTYPE##_##RTYPE(gdv_##LTYPE in1, gdv_##RTYPE in2) { \
316+
return static_cast<gdv_##LTYPE>(in1 >> in2); \
316317
}
317318

318319
SHIFT_RIGHT_INT(int32, int32)

0 commit comments

Comments
 (0)