Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
Impala 2.2
Description
TimestampValue::ToTimestampVal() require input is a valid TimestampValue.
// Returns a TimestampVal representation in the output variable. The caller must ensure // the TimestampValue instance has a valid date or time before calling. void ToTimestampVal(impala_udf::TimestampVal* tv) const { DCHECK(HasDateOrTime());
However in quite a few place, caller doesn't guarantee this. for example:
TimestampVal DecimalOperators::CastToTimestampVal( FunctionContext* context, const DecimalVal& val) { if (val.is_null) return TimestampVal::null(); ColumnType val_type = AnyValUtil::TypeDescToColumnType(*context->GetArgType(0)); DCHECK_EQ(val_type.type, TYPE_DECIMAL); TimestampVal result; switch (val_type.GetByteSize()) { case 4: { Decimal4Value dv(val.val4); TimestampValue tv(dv.ToDouble(val_type)); tv.ToTimestampVal(&result); break; }
This cause a DCHECK failure. and crash if debug build is used.