imay commented on a change in pull request #2554: Support load orc format in Apache Doris URL: https://github.com/apache/incubator-doris/pull/2554#discussion_r363145173
########## File path: be/src/exec/orc_scanner.h ########## @@ -0,0 +1,78 @@ +// 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 ORC_SCANNER_H +#define ORC_SCANNER_H + +#include <orc/OrcFile.hh> +#include "exec/base_scanner.h" + +namespace doris { + +// Broker scanner convert the data read from broker to doris's tuple. +class ORCScanner : public BaseScanner { +public: + ORCScanner(RuntimeState *state, + RuntimeProfile *profile, + const TBrokerScanRangeParams& params, + const std::vector<TBrokerRangeDesc>& ranges, + const std::vector<TNetworkAddress>& broker_addresses, ScannerCounter *counter); + + ~ORCScanner() override; + + // Open this scanner, will initialize information need to + Status open() override; + + // Get next tuple + Status get_next(Tuple *tuple, MemPool *tuple_pool, bool *eof) override; + + // Close this scanner + void close() override; + +private: + // Read next buffer from reader + Status open_next_reader(); + +private: + const std::vector<TBrokerRangeDesc>& _ranges; + const std::vector<TNetworkAddress>& _broker_addresses; + + // Reader + int _next_range; + bool _cur_file_eof; + bool _scanner_eof; + + // orc file reader object + orc::ReaderOptions _options; + orc::RowReaderOptions _rowReaderOptions; + std::shared_ptr<orc::ColumnVectorBatch> _batch; + std::unique_ptr<orc::Reader> _reader; + std::unique_ptr<orc::RowReader> _row_reader; + std::list<std::string> _includes; // include columns in orc file Review comment: ```suggestion std::list<std::string> _include_cols; // include columns in orc file ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
