MCPcopy Create free account
hub / github.com/apache/impala / DebugString

Method DebugString

be/src/exprs/literal.cc:327–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327string Literal::DebugString() const {
328 stringstream out;
329 out << "Literal(value=";
330 switch (type_.type) {
331 case TYPE_BOOLEAN:
332 out << std::to_string(value_.bool_val);
333 break;
334 case TYPE_TINYINT:
335 out << std::to_string(value_.tinyint_val);
336 break;
337 case TYPE_SMALLINT:
338 out << std::to_string(value_.smallint_val);
339 break;
340 case TYPE_INT:
341 out << std::to_string(value_.int_val);
342 break;
343 case TYPE_BIGINT:
344 out << std::to_string(value_.bigint_val);
345 break;
346 case TYPE_FLOAT:
347 out << std::to_string(value_.float_val);
348 break;
349 case TYPE_DOUBLE:
350 out << std::to_string(value_.double_val);
351 break;
352 case TYPE_STRING:
353 out << value_.string_val;
354 break;
355 case TYPE_DECIMAL:
356 switch (type().GetByteSize()) {
357 case 4:
358 out << value_.decimal4_val.ToString(type());
359 break;
360 case 8:
361 out << value_.decimal8_val.ToString(type());
362 break;
363 case 16:
364 out << value_.decimal16_val.ToString(type());
365 break;
366 default:
367 DCHECK(false) << type_.DebugString();
368 }
369 break;
370 case TYPE_TIMESTAMP:
371 out << value_.timestamp_val;
372 break;
373 case TYPE_DATE:
374 out << value_.date_val;
375 break;
376 default:
377 out << "[bad type! " << type_ << "]";
378 }
379 out << ScalarExpr::DebugString() << ")";
380 return out.str();
381}
382
383// IR produced for bigint literal 10:
384//

Callers 3

LiteralMethod · 0.45

Calls 5

GetByteSizeMethod · 0.80
DebugStringFunction · 0.70
typeEnum · 0.50
ToStringMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected