| 184 | ~DataStreamTest() { runtime_state_->ReleaseResources(); } |
| 185 | |
| 186 | virtual void SetUp() { |
| 187 | exec_env_.reset(new ExecEnv()); |
| 188 | ABORT_IF_ERROR(exec_env_->InitForFeSupport()); |
| 189 | // Always use aggressive decommit for backend tests |
| 190 | FLAGS_tcmalloc_aggressive_memory_decommit = true; |
| 191 | ABORT_IF_ERROR(MallocUtil::GetInstance()->Init()); |
| 192 | exec_env_->InitBufferPool(32 * 1024, 1024 * 1024 * 1024, 32 * 1024); |
| 193 | runtime_state_.reset(new RuntimeState(TQueryCtx(), exec_env_.get())); |
| 194 | TPlanFragment* fragment = runtime_state_->obj_pool()->Add(new TPlanFragment()); |
| 195 | PlanFragmentCtxPB* fragment_ctx = |
| 196 | runtime_state_->obj_pool()->Add(new PlanFragmentCtxPB()); |
| 197 | fragment_state_ = runtime_state_->obj_pool()->Add( |
| 198 | new FragmentState(runtime_state_->query_state(), *fragment, *fragment_ctx)); |
| 199 | mem_pool_.reset(new MemPool(&tracker_)); |
| 200 | |
| 201 | // Register a BufferPool client for allocating buffers for row batches. |
| 202 | ABORT_IF_ERROR(exec_env_->buffer_pool()->RegisterClient( |
| 203 | "DataStream Test Recvr", nullptr, exec_env_->buffer_reservation(), &tracker_, |
| 204 | numeric_limits<int64_t>::max(), runtime_state_->runtime_profile(), |
| 205 | &buffer_pool_client_)); |
| 206 | |
| 207 | CreateRowDesc(); |
| 208 | |
| 209 | SlotRef* lhs_slot = obj_pool_.Add(new SlotRef(ColumnType(TYPE_BIGINT), 0)); |
| 210 | ASSERT_OK(lhs_slot->Init(RowDescriptor(), true, fragment_state_)); |
| 211 | ordering_exprs_.push_back(lhs_slot); |
| 212 | |
| 213 | tsort_info_.sorting_order = TSortingOrder::LEXICAL; |
| 214 | tsort_info_.is_asc_order.push_back(true); |
| 215 | tsort_info_.nulls_first.push_back(true); |
| 216 | |
| 217 | next_instance_id_.set_lo(0); |
| 218 | next_instance_id_.set_hi(0); |
| 219 | stream_mgr_ = exec_env_->stream_mgr(); |
| 220 | |
| 221 | broadcast_sink_.dest_node_id = DEST_NODE_ID; |
| 222 | broadcast_sink_.output_partition.type = TPartitionType::UNPARTITIONED; |
| 223 | |
| 224 | random_sink_.dest_node_id = DEST_NODE_ID; |
| 225 | random_sink_.output_partition.type = TPartitionType::RANDOM; |
| 226 | |
| 227 | hash_sink_.dest_node_id = DEST_NODE_ID; |
| 228 | hash_sink_.output_partition.type = TPartitionType::HASH_PARTITIONED; |
| 229 | // there's only one column to partition on |
| 230 | TExprNode expr_node; |
| 231 | expr_node.node_type = TExprNodeType::SLOT_REF; |
| 232 | expr_node.type.types.push_back(TTypeNode()); |
| 233 | expr_node.type.types.back().__isset.scalar_type = true; |
| 234 | expr_node.type.types.back().scalar_type.type = TPrimitiveType::BIGINT; |
| 235 | expr_node.num_children = 0; |
| 236 | TSlotRef slot_ref; |
| 237 | slot_ref.slot_id = 0; |
| 238 | expr_node.__set_slot_ref(slot_ref); |
| 239 | TExpr expr; |
| 240 | expr.nodes.push_back(expr_node); |
| 241 | hash_sink_.output_partition.__isset.partition_exprs = true; |
| 242 | hash_sink_.output_partition.partition_exprs.push_back(expr); |
| 243 |
nothing calls this directly
no test coverage detected