You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2023/01/09 16:26:25 UTC

[GitHub] [doris] github-actions[bot] commented on a diff in pull request #15618: [feature-wip](multi-catalog) add iceberg tvf to read snapshots

github-actions[bot] commented on code in PR #15618:
URL: https://github.com/apache/doris/pull/15618#discussion_r1064832310


##########
be/src/vec/exec/scan/vmeta_scanner.cpp:
##########
@@ -0,0 +1,209 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "vmeta_scanner.h"
+
+#include <gen_cpp/FrontendService_types.h>
+#include <gen_cpp/HeartbeatService_types.h>
+
+#include "gen_cpp/FrontendService.h"
+#include "runtime/client_cache.h"
+#include "util/thrift_rpc_helper.h"
+#include "vec/runtime/vdatetime_value.h"
+
+namespace doris::vectorized {
+
+VMetaScanner::VMetaScanner(RuntimeState* state, VMetaScanNode* parent, int64_t tuple_id,
+                           const TScanRangeParams& scan_range, int64_t limit)
+        : VScanner(state, static_cast<VScanNode*>(parent), limit),
+          _parent(parent),
+          _meta_eos(false),
+          _tuple_id(tuple_id),
+          _scan_range(scan_range.scan_range) {}
+
+Status VMetaScanner::open(RuntimeState* state) {
+    VLOG_CRITICAL << "VMetaScanner::open";
+    RETURN_IF_ERROR(VScanner::open(state));
+    return Status::OK();
+}
+
+Status VMetaScanner::prepare(RuntimeState* state, VExprContext** vconjunct_ctx_ptr) {
+    VLOG_CRITICAL << "VMetaScanner::prepare";
+    if (vconjunct_ctx_ptr != nullptr) {
+        // Copy vconjunct_ctx_ptr from scan node to this scanner's _vconjunct_ctx.
+        RETURN_IF_ERROR((*vconjunct_ctx_ptr)->clone(_state, &_vconjunct_ctx));
+    }
+    _tuple_desc = state->desc_tbl().get_tuple_descriptor(_tuple_id);
+    if (_scan_range.meta_scan_range.__isset.iceberg_params) {
+        RETURN_IF_ERROR(_fetch_iceberg_metadata_batch());
+    } else {
+        _meta_eos = true;
+    }
+    return Status::OK();
+}
+
+Status VMetaScanner::_get_block_impl(RuntimeState* state, Block* block, bool* eof) {
+    VLOG_CRITICAL << "VMetaScanner::_get_block_impl";
+    if (nullptr == state || nullptr == block || nullptr == eof) {
+        return Status::InternalError("input is NULL pointer");
+    }
+    if (_meta_eos == true) {
+        *eof = true;
+        return Status::OK();
+    }
+
+    auto column_size = _tuple_desc->slots().size();
+    std::vector<MutableColumnPtr> columns(column_size);
+    bool mem_reuse = block->mem_reuse();
+    do {
+        RETURN_IF_CANCELLED(state);
+
+        columns.resize(column_size);
+        for (auto i = 0; i < column_size; i++) {
+            if (mem_reuse) {
+                columns[i] = std::move(*block->get_by_position(i).column).mutate();

Review Comment:
   warning: std::move of the const expression has no effect; remove std::move() [performance-move-const-arg]
   
   ```suggestion
                   columns[i] = *block->get_by_position(i).column.mutate();
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org