File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ Result<Literal> LiteralCaster::CastFromInt(
105105 return Literal::Date (int_val);
106106 case TypeId::kDecimal : {
107107 auto decimal_type = std::static_pointer_cast<DecimalType>(target_type);
108- return Literal::Decimal (int_val, decimal_type->precision (), decimal_type->scale ());
108+ return Literal::Decimal (static_cast <int128_t >(int_val), decimal_type->precision (),
109+ decimal_type->scale ());
109110 }
110111 default :
111112 return NotSupported (" Cast from Int to {} is not implemented" ,
@@ -149,7 +150,8 @@ Result<Literal> LiteralCaster::CastFromLong(
149150 return Literal::TimestampTz (long_val);
150151 case TypeId::kDecimal : {
151152 auto decimal_type = std::static_pointer_cast<DecimalType>(target_type);
152- return Literal::Decimal (long_val, decimal_type->precision (), decimal_type->scale ());
153+ return Literal::Decimal (static_cast <int128_t >(long_val), decimal_type->precision (),
154+ decimal_type->scale ());
153155 }
154156 default :
155157 return NotSupported (" Cast from Long to {} is not supported" ,
You can’t perform that action at this time.
0 commit comments