This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 00863f25e9 [improvement](profile) add table name for file scan node
(#22299)
00863f25e9 is described below
commit 00863f25e9104b5d35784843a2f918379f3c26d7
Author: Mingyu Chen <[email protected]>
AuthorDate: Thu Jul 27 23:54:31 2023 +0800
[improvement](profile) add table name for file scan node (#22299)
```
VFILE_SCAN_NODE(region) (id=0):(Active: 3.537us, % non-child: 0.00%)
- RuntimeFilters: :
- UseSpecificThreadToken: False
- AcquireRuntimeFilterTime: 501ns
- AllocateResourceTime: 105.598us
```
---
be/src/vec/exec/scan/new_file_scan_node.cpp | 5 +++++
be/src/vec/exec/scan/new_file_scan_node.h | 4 ++++
.../main/java/org/apache/doris/planner/external/FileScanNode.java | 3 +++
gensrc/thrift/PlanNodes.thrift | 1 +
4 files changed, 13 insertions(+)
diff --git a/be/src/vec/exec/scan/new_file_scan_node.cpp
b/be/src/vec/exec/scan/new_file_scan_node.cpp
index 0b8d318551..5eb8d7e1c6 100644
--- a/be/src/vec/exec/scan/new_file_scan_node.cpp
+++ b/be/src/vec/exec/scan/new_file_scan_node.cpp
@@ -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) {
@@ -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
diff --git a/be/src/vec/exec/scan/new_file_scan_node.h
b/be/src/vec/exec/scan/new_file_scan_node.h
index 7654d25bb2..740e354db5 100644
--- a/be/src/vec/exec/scan/new_file_scan_node.h
+++ b/be/src/vec/exec/scan/new_file_scan_node.h
@@ -49,6 +49,8 @@ public:
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;
@@ -62,5 +64,7 @@ private:
// 2. parquet file meta
// KVCache<std::string> _kv_cache;
std::unique_ptr<ShardedKVCache> _kv_cache;
+
+ std::string _table_name;
};
} // namespace doris::vectorized
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileScanNode.java
b/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileScanNode.java
index 9a050cc139..5af4a5f123 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileScanNode.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileScanNode.java
@@ -79,6 +79,9 @@ public abstract class FileScanNode extends ExternalScanNode {
planNode.setNodeType(TPlanNodeType.FILE_SCAN_NODE);
TFileScanNode fileScanNode = new TFileScanNode();
fileScanNode.setTupleId(desc.getId().asInt());
+ if (desc.getTable() != null) {
+ fileScanNode.setTableName(desc.getTable().getName());
+ }
planNode.setFileScanNode(fileScanNode);
}
diff --git a/gensrc/thrift/PlanNodes.thrift b/gensrc/thrift/PlanNodes.thrift
index a68dc096fd..05f9f0972d 100644
--- a/gensrc/thrift/PlanNodes.thrift
+++ b/gensrc/thrift/PlanNodes.thrift
@@ -506,6 +506,7 @@ struct TBrokerScanNode {
struct TFileScanNode {
1: optional Types.TTupleId tuple_id
+ 2: optional string table_name
}
struct TEsScanNode {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]