Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-2914

Hit DCHECK Check failed: HasDateOrTime()

    XMLWordPrintableJSON

Details

    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.

      Attachments

        Activity

          People

            jyu@cloudera.com Juan Yu
            jyu@cloudera.com Juan Yu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: