This is an automated email from the ASF dual-hosted git repository.
mrhhsg pushed a commit to branch nested_column_prune
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/nested_column_prune by this
push:
new 5bbdab65a13 fix: missed pruned type with map/array types
5bbdab65a13 is described below
commit 5bbdab65a13757d3ede525d3d02d2f48e76f77b4
Author: Hu Shenggang <[email protected]>
AuthorDate: Tue Nov 4 14:26:08 2025 +0800
fix: missed pruned type with map/array types
---
be/src/http/action/debug_point_action.cpp | 4 +++-
be/src/olap/rowset/segment_v2/column_reader.cpp | 2 ++
be/src/olap/tablet_schema.cpp | 5 +++-
be/src/vec/exec/scan/olap_scanner.cpp | 4 +++-
.../complex_types/test_pruned_columns.out | 7 ++++++
.../complex_types/test_pruned_columns.groovy | 27 ++++++++++++++++++++++
6 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/be/src/http/action/debug_point_action.cpp
b/be/src/http/action/debug_point_action.cpp
index 04aa38efaa4..600ae645341 100644
--- a/be/src/http/action/debug_point_action.cpp
+++ b/be/src/http/action/debug_point_action.cpp
@@ -35,11 +35,13 @@ void BaseDebugPointAction::handle(HttpRequest* req) {
"Disable debug points. please check
config::enable_debug_points");
}
std::string result = status.to_json();
- LOG(INFO) << "handle request result:" << result;
+ LOG(INFO) << "handle request result:" << result << ", status: " <<
status.to_string();
if (status.ok()) {
+ LOG(INFO) << "***** send ok";
HttpChannel::send_reply(req, HttpStatus::OK, result);
} else {
HttpChannel::send_reply(req, HttpStatus::INTERNAL_SERVER_ERROR,
result);
+ LOG(INFO) << "***** send error";
}
}
diff --git a/be/src/olap/rowset/segment_v2/column_reader.cpp
b/be/src/olap/rowset/segment_v2/column_reader.cpp
index 8f551182079..83319f66b04 100644
--- a/be/src/olap/rowset/segment_v2/column_reader.cpp
+++ b/be/src/olap/rowset/segment_v2/column_reader.cpp
@@ -946,6 +946,8 @@ Result<TColumnAccessPaths>
ColumnIterator::_get_sub_access_paths(
if (!name_path.data_access_path.path.empty()) {
++it;
} else {
+ LOG(INFO) << "********* set _column_name: " << _column_name
+ << " need_to_read true **********";
set_need_to_read();
it = sub_access_paths.erase(it);
}
diff --git a/be/src/olap/tablet_schema.cpp b/be/src/olap/tablet_schema.cpp
index 442774f1f00..6d4a9f90ab8 100644
--- a/be/src/olap/tablet_schema.cpp
+++ b/be/src/olap/tablet_schema.cpp
@@ -1680,11 +1680,14 @@ vectorized::Block TabletSchema::create_block(
tablet_columns_need_convert_null->find(cid) !=
tablet_columns_need_convert_null->end());
auto data_type =
vectorized::DataTypeFactory::instance().create_data_type(col, is_nullable);
- if (col.type() == FieldType::OLAP_FIELD_TYPE_STRUCT) {
+ if (col.type() == FieldType::OLAP_FIELD_TYPE_STRUCT ||
+ col.type() == FieldType::OLAP_FIELD_TYPE_MAP ||
+ col.type() == FieldType::OLAP_FIELD_TYPE_ARRAY) {
if (_pruned_columns_data_type.contains(col.unique_id())) {
data_type = _pruned_columns_data_type.at(col.unique_id());
}
}
+
if (_vir_col_idx_to_unique_id.contains(cid)) {
block.insert({vectorized::ColumnNothing::create(0), data_type,
col.name()});
VLOG_DEBUG << fmt::format(
diff --git a/be/src/vec/exec/scan/olap_scanner.cpp
b/be/src/vec/exec/scan/olap_scanner.cpp
index f34838c9fa1..53763e14693 100644
--- a/be/src/vec/exec/scan/olap_scanner.cpp
+++ b/be/src/vec/exec/scan/olap_scanner.cpp
@@ -556,7 +556,9 @@ Status OlapScanner::_init_return_columns() {
{column.unique_id(), slot->predicate_access_paths()});
}
- if (slot->type()->get_primitive_type() == PrimitiveType::TYPE_STRUCT &&
+ if ((slot->type()->get_primitive_type() == PrimitiveType::TYPE_STRUCT
||
+ slot->type()->get_primitive_type() == PrimitiveType::TYPE_MAP ||
+ slot->type()->get_primitive_type() == PrimitiveType::TYPE_ARRAY)
&&
!slot->all_access_paths().empty()) {
tablet_schema->add_pruned_columns_data_type(column.unique_id(),
slot->type());
}
diff --git
a/regression-test/data/datatype_p0/complex_types/test_pruned_columns.out
b/regression-test/data/datatype_p0/complex_types/test_pruned_columns.out
index 74f336d27e5..870a5763074 100644
--- a/regression-test/data/datatype_p0/complex_types/test_pruned_columns.out
+++ b/regression-test/data/datatype_p0/complex_types/test_pruned_columns.out
@@ -22,3 +22,10 @@
1 beijing
2 shanghai
+-- !sql6 --
+2
+
+-- !sql7 --
+0.41
+0.99
+
diff --git
a/regression-test/suites/datatype_p0/complex_types/test_pruned_columns.groovy
b/regression-test/suites/datatype_p0/complex_types/test_pruned_columns.groovy
index ad032fab8f2..d54d924e97f 100644
---
a/regression-test/suites/datatype_p0/complex_types/test_pruned_columns.groovy
+++
b/regression-test/suites/datatype_p0/complex_types/test_pruned_columns.groovy
@@ -58,4 +58,31 @@ suite("test_pruned_columns") {
qt_sql5 """
select id, struct_element(s, 'city') from `tbl_test_pruned_columns`
where struct_element(struct_element(s, 'data')[1][2], 'b') = 40 order by 1;
"""
+
+ sql """DROP TABLE IF EXISTS `tbl_test_pruned_columns_map`"""
+ sql """
+ CREATE TABLE `tbl_test_pruned_columns_map` (
+ `id` bigint NULL,
+ `dynamic_attributes`
map<text,struct<attribute_value:text,confidence_score:double,last_updated:datetime>>
NULL
+ ) ENGINE=OLAP
+ DUPLICATE KEY(`id`)
+ DISTRIBUTED BY RANDOM BUCKETS AUTO
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1"
+ );
+ """
+
+ sql """
+ insert into `tbl_test_pruned_columns_map` values
+ (1, '{"theme_preference":{"attribute_value":"light",
"confidence_score":0.41, "last_updated":"2025-11-03 15:32:33"},
"language_setting":{"attribute_value":"es", "confidence_score":0.65,
"last_updated":"2025-11-03 15:32:33"}}'),
+ (2, '{"theme_preference":{"attribute_value":"light",
"confidence_score":0.99, "last_updated":"2025-11-03 15:32:33"},
"language_setting":{"attribute_value":"es", "confidence_score":0.92,
"last_updated":"2025-11-03 15:32:33"}}');
+ """
+
+ qt_sql6 """
+ select count(struct_element(dynamic_attributes['theme_preference'],
'confidence_score')) from `tbl_test_pruned_columns_map`;
+ """
+
+ qt_sql7 """
+ select struct_element(dynamic_attributes['theme_preference'],
'confidence_score') from `tbl_test_pruned_columns_map` order by id;
+ """
}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]