Skip to content

Commit

Permalink
[improvement](profile) add table name for file scan node
Browse files Browse the repository at this point in the history
  • Loading branch information
morningman committed Jul 27, 2023
1 parent e78afed commit 2a430d9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions be/src/vec/exec/scan/new_file_scan_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ NewFileScanNode::NewFileScanNode(ObjectPool* pool, const TPlanNode& tnode,
const DescriptorTbl& descs)
: VScanNode(pool, tnode, descs) {
_output_tuple_id = tnode.file_scan_node.tuple_id;
_table_name = tnode.file_scan_node.__isset.table_name ? tnode.file_scan_node.table_name : "";
}

Status NewFileScanNode::init(const TPlanNode& tnode, RuntimeState* state) {
Expand Down Expand Up @@ -128,4 +129,8 @@ Status NewFileScanNode::_init_scanners(std::list<VScannerSPtr>* scanners) {
return Status::OK();
}

std::string NewFileScanNode::get_name() {
return fmt::format("VFILE_SCAN_NODE({0})", _table_name);
}

}; // namespace doris::vectorized
4 changes: 4 additions & 0 deletions be/src/vec/exec/scan/new_file_scan_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class NewFileScanNode : public VScanNode {

void set_scan_ranges(const std::vector<TScanRangeParams>& scan_ranges) override;

std::string get_name() override;

protected:
Status _init_profile() override;
Status _process_conjuncts() override;
Expand All @@ -62,5 +64,7 @@ class NewFileScanNode : public VScanNode {
// 2. parquet file meta
// KVCache<std::string> _kv_cache;
std::unique_ptr<ShardedKVCache> _kv_cache;

std::string _table_name;
};
} // namespace doris::vectorized
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ protected void toThrift(TPlanNode planNode) {
planNode.setNodeType(TPlanNodeType.FILE_SCAN_NODE);
TFileScanNode fileScanNode = new TFileScanNode();
fileScanNode.setTupleId(desc.getId().asInt());
fileScanNode.setTableName(desc.getTable().getName());
planNode.setFileScanNode(fileScanNode);
}

Expand Down
1 change: 1 addition & 0 deletions gensrc/thrift/PlanNodes.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ struct TBrokerScanNode {

struct TFileScanNode {
1: optional Types.TTupleId tuple_id
2: optional string table_name
}

struct TEsScanNode {
Expand Down

0 comments on commit 2a430d9

Please sign in to comment.