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 2022/05/02 05:40:33 UTC

[GitHub] [incubator-doris] HappenLee commented on a diff in pull request #9311: [feature]add vectorized vjson_scanner

HappenLee commented on code in PR #9311:
URL: https://github.com/apache/incubator-doris/pull/9311#discussion_r862598988


##########
be/src/vec/exec/vjson_scanner.h:
##########
@@ -0,0 +1,158 @@
+// 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.
+
+#ifndef BE_SRC_VJSON_SCANNER_H_
+#define BE_SRC_VJSON_SCANNER_H_
+
+#include <rapidjson/document.h>
+#include <rapidjson/error/en.h>
+#include <rapidjson/stringbuffer.h>
+#include <rapidjson/writer.h>
+
+#include <map>
+#include <memory>
+#include <sstream>
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+#include "common/status.h"
+#include "exec/base_scanner.h"
+#include "exec/json_scanner.h"
+#include "exec/exec_node.h"
+#include "runtime/row_batch.h"
+#include "runtime/descriptors.h"
+#include "runtime/mem_pool.h"
+#include "runtime/tuple.h"
+#include "runtime/mem_tracker.h"
+#include "util/runtime_profile.h"
+#include "exprs/expr_context.h"
+
+namespace doris {
+class ExprContext;
+
+namespace vectorized {
+class VJsonReader;
+
+class VJsonScanner : public JsonScanner {
+public:
+    VJsonScanner(RuntimeState* state, RuntimeProfile* profile, const TBrokerScanRangeParams& params,
+                const std::vector<TBrokerRangeDesc>& ranges,
+                const std::vector<TNetworkAddress>& broker_addresses,
+                const std::vector<TExpr>& pre_filter_texprs,
+                ScannerCounter* counter);
+        
+    ~VJsonScanner();
+    
+    Status open() override;
+
+    void close() override;
+
+    // Status get_next(std::vector<MutableColumnPtr>& columns, bool* eof) override;
+    Status get_next(vectorized::Block& output_block, bool* eof) override;
+
+private:
+    Status open_vjson_reader();
+    Status open_next_reader();
+
+private:
+    const std::vector<TBrokerRangeDesc>& _ranges;
+    const std::vector<TNetworkAddress>& _broker_addresses;
+
+    // Reader
+    FileReader* _cur_file_reader;

Review Comment:
   This is a bad design. There is a member variable with the same name in the parent-child class. You should reuse it instead of using it with private



-- 
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