31 return *tuple_builder;
35 int slot_idx,
int byte_offset) {
36 int null_byte = slot_idx / 8;
37 int null_bit = slot_idx % 8;
38 TSlotDescriptor slot_desc;
39 slot_desc.__set_id(
id);
40 slot_desc.__set_parent(parent_id);
41 slot_desc.__set_slotType(type.
ToThrift());
42 slot_desc.__set_columnPath(vector<int>(1, slot_idx));
43 slot_desc.__set_byteOffset(byte_offset);
44 slot_desc.__set_nullIndicatorByte(null_byte);
45 slot_desc.__set_nullIndicatorBit(null_bit);
46 slot_desc.__set_slotIdx(slot_idx);
47 slot_desc.__set_isMaterialized(
true);
52 TTupleDescriptor tuple_desc;
53 tuple_desc.__set_id(
id);
54 tuple_desc.__set_byteSize(byte_size);
55 tuple_desc.__set_numNullBytes(num_null_bytes);
61 TDescriptorTable thrift_desc_tbl;
65 vector<ColumnType> slot_types =
tuples_descs_[i]->slot_types();
67 int byte_offset = num_null_bytes;
70 for(
int j = 0; j < slot_types.size(); ++j) {
71 thrift_desc_tbl.slotDescriptors.push_back(
74 int byte_size = slot_types[j].GetByteSize();
80 byte_offset += byte_size;
83 thrift_desc_tbl.tupleDescriptors.push_back(
DescriptorTblBuilder(ObjectPool *object_pool)
std::vector< TupleDescBuilder * > tuples_descs_
ObjectPool * obj_pool_
Owned by caller.
boost::scoped_ptr< ObjectPool > obj_pool_
Object pool owned by the coordinator. Any executor will have its own pool.
ObjectPool * obj_pool()
Returns a local object pool.
static TSlotDescriptor MakeSlotDescriptor(int id, int parent_id, const ColumnType &type, int slot_idx, int byte_offset)
static int Ceil(int value, int divisor)
Returns the ceil of value/divisor.
static TTupleDescriptor MakeTupleDescriptor(int id, int byte_size, int num_null_bytes)
TupleDescBuilder & DeclareTuple()
static Status Create(ObjectPool *pool, const TDescriptorTable &thrift_tbl, DescriptorTbl **tbl)
TColumnType ToThrift() const