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

Method CodegenToTimestampValue

be/src/runtime/descriptors.cc:1562–1581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1560}
1561
1562llvm::Value* SlotDescriptor::CodegenToTimestampValue(
1563 const CodegenAnyValReadWriteInfo& read_write_info) {
1564 const ColumnType& type = read_write_info.type();
1565 DCHECK_EQ(type.type, TYPE_TIMESTAMP);
1566 // Convert TimestampVal to TimestampValue
1567 // TimestampValue has type
1568 // { boost::posix_time::time_duration, boost::gregorian::date }
1569 // = { {{{i64}}}, {{i32}} }
1570 llvm::Type* raw_type = read_write_info.codegen()->GetSlotType(type);
1571 llvm::Value* timestamp_value = llvm::Constant::getNullValue(raw_type);
1572 uint32_t time_of_day_idxs[] = {0, 0, 0, 0};
1573
1574 LlvmBuilder* builder = read_write_info.builder();
1575 timestamp_value = builder->CreateInsertValue(
1576 timestamp_value, read_write_info.GetTimeAndDate().time_of_day, time_of_day_idxs);
1577 uint32_t date_idxs[] = {1, 0, 0};
1578 timestamp_value = builder->CreateInsertValue(
1579 timestamp_value, read_write_info.GetTimeAndDate().date, date_idxs);
1580 return timestamp_value;
1581}
1582
1583vector<SlotDescriptor*> TupleDescriptor::SlotsOrderedByIdx() const {
1584 vector<SlotDescriptor*> sorted_slots(slots().size());

Callers

nothing calls this directly

Calls 4

GetSlotTypeMethod · 0.80
typeMethod · 0.45
codegenMethod · 0.45
builderMethod · 0.45

Tested by

no test coverage detected