diff --git a/be/src/vec/exec/scan/vmeta_scanner.cpp b/be/src/vec/exec/scan/vmeta_scanner.cpp index d5706e34786d75..1f4dcd8593de9a 100644 --- a/be/src/vec/exec/scan/vmeta_scanner.cpp +++ b/be/src/vec/exec/scan/vmeta_scanner.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -83,6 +84,17 @@ Status VMetaScanner::prepare(RuntimeState* state, const VExprContextSPtrs& conju VLOG_CRITICAL << "VMetaScanner::prepare"; RETURN_IF_ERROR(VScanner::prepare(_state, conjuncts)); _tuple_desc = state->desc_tbl().get_tuple_descriptor(_tuple_id); + bool has_col_nullable = + std::any_of(std::begin(_tuple_desc->slots()), std::end(_tuple_desc->slots()), + [](SlotDescriptor* slot_desc) { return slot_desc->is_nullable(); }); + + if (has_col_nullable) { + // We do not allow any columns to be Nullable here, since FE can not + // transmit a NULL value to BE, so we can not distinguish a empty string + // from a NULL value. + return Status::InternalError("Logical error, VMetaScanner do not allow ColumnNullable"); + } + RETURN_IF_ERROR(_fetch_metadata(_scan_range.meta_scan_range)); return Status::OK(); } @@ -112,7 +124,7 @@ Status VMetaScanner::_get_block_impl(RuntimeState* state, Block* block, bool* eo } } // fill block - static_cast(_fill_block_with_remote_data(columns)); + RETURN_IF_ERROR(_fill_block_with_remote_data(columns)); if (_meta_eos == true) { if (block->rows() == 0) { *eof = true; @@ -146,11 +158,9 @@ Status VMetaScanner::_fill_block_with_remote_data(const std::vectoris_nullable() == true) { - auto* nullable_column = reinterpret_cast(col_ptr); - col_ptr = &nullable_column->get_nested_column(); - } switch (slot_desc->type().type) { case TYPE_BOOLEAN: { bool data = _batch_data[_row_idx].column_value[col_idx].boolVal; diff --git a/docs/en/docs/sql-manual/sql-functions/table-functions/queries.md b/docs/en/docs/sql-manual/sql-functions/table-functions/queries.md index 26527c39685d3a..ebc2cb3ebe4de1 100644 --- a/docs/en/docs/sql-manual/sql-functions/table-functions/queries.md +++ b/docs/en/docs/sql-manual/sql-functions/table-functions/queries.md @@ -51,11 +51,11 @@ mysql> desc function queries(); +------------------+--------+------+-------+---------+-------+ | QueryId | TEXT | No | false | NULL | NONE | | StartTime | BIGINT | No | false | NULL | NONE | -| EndTime | BIGINT | Yes | false | NULL | NONE | -| EventTime | BIGINT | Yes | false | NULL | NONE | +| EndTime | BIGINT | No | false | NULL | NONE | +| EventTime | BIGINT | No | false | NULL | NONE | | Latency | BIGINT | No | false | NULL | NONE | | State | TEXT | No | false | NULL | NONE | -| Database | TEXT | Yes | false | NULL | NONE | +| Database | TEXT | No | false | NULL | NONE | | Sql | TEXT | No | false | NULL | NONE | | FrontendInstance | TEXT | No | false | NULL | NONE | +------------------+--------+------+-------+---------+-------+ diff --git a/docs/zh-CN/docs/sql-manual/sql-functions/table-functions/queries.md b/docs/zh-CN/docs/sql-manual/sql-functions/table-functions/queries.md index cdfd3e75fd2d25..e3f22da7ad522a 100644 --- a/docs/zh-CN/docs/sql-manual/sql-functions/table-functions/queries.md +++ b/docs/zh-CN/docs/sql-manual/sql-functions/table-functions/queries.md @@ -51,11 +51,11 @@ mysql> desc function queries(); +------------------+--------+------+-------+---------+-------+ | QueryId | TEXT | No | false | NULL | NONE | | StartTime | BIGINT | No | false | NULL | NONE | -| EndTime | BIGINT | Yes | false | NULL | NONE | -| EventTime | BIGINT | Yes | false | NULL | NONE | +| EndTime | BIGINT | No | false | NULL | NONE | +| EventTime | BIGINT | No | false | NULL | NONE | | Latency | BIGINT | No | false | NULL | NONE | | State | TEXT | No | false | NULL | NONE | -| Database | TEXT | Yes | false | NULL | NONE | +| Database | TEXT | No | false | NULL | NONE | | Sql | TEXT | No | false | NULL | NONE | | FrontendInstance | TEXT | No | false | NULL | NONE | +------------------+--------+------+-------+---------+-------+ diff --git a/fe/fe-core/src/main/java/org/apache/doris/tablefunction/QueriesTableValuedFunction.java b/fe/fe-core/src/main/java/org/apache/doris/tablefunction/QueriesTableValuedFunction.java index 77aeed6c89e9d0..e6004cfb62c6fe 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/tablefunction/QueriesTableValuedFunction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/tablefunction/QueriesTableValuedFunction.java @@ -37,11 +37,11 @@ public class QueriesTableValuedFunction extends MetadataTableValuedFunction { private static final ImmutableList SCHEMA = ImmutableList.of( new Column("QueryId", ScalarType.createStringType()), new Column("StartTime", PrimitiveType.BIGINT), - new Column("EndTime", PrimitiveType.BIGINT, true), - new Column("EventTime", PrimitiveType.BIGINT, true), + new Column("EndTime", PrimitiveType.BIGINT), + new Column("EventTime", PrimitiveType.BIGINT), new Column("Latency", PrimitiveType.BIGINT), new Column("State", ScalarType.createStringType()), - new Column("Database", ScalarType.createStringType(), true), + new Column("Database", ScalarType.createStringType()), new Column("Sql", ScalarType.createStringType()), new Column("FrontendInstance", ScalarType.createStringType()));