From 86252f372641f8c5181724da09d1e5b907b08a7d Mon Sep 17 00:00:00 2001 From: Chang Chen Date: Thu, 26 Oct 2023 16:22:59 +0800 Subject: [PATCH] Revert https://github.com/oap-project/gluten/pull/1837 since https://github.com/ClickHouse/ClickHouse/pull/56014. Fix build due to removing -Wno-shadow-field --- .../Parser/scalar_function_parser/parseUrl.h | 2 +- .../Rewriter/ExpressionRewriter.h | 2 +- .../local-engine/Shuffle/PartitionWriter.cpp | 4 +-- .../SubstraitSource/ExcelTextFormatFile.cpp | 28 +++++++++---------- .../SubstraitSource/ExcelTextFormatFile.h | 4 +-- cpp-ch/local-engine/proto/CMakeLists.txt | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cpp-ch/local-engine/Parser/scalar_function_parser/parseUrl.h b/cpp-ch/local-engine/Parser/scalar_function_parser/parseUrl.h index 59e47011091ad..9d8aae8e21a6c 100644 --- a/cpp-ch/local-engine/Parser/scalar_function_parser/parseUrl.h +++ b/cpp-ch/local-engine/Parser/scalar_function_parser/parseUrl.h @@ -22,7 +22,7 @@ class ParseURLParser final : public FunctionParser { public: static constexpr auto name = "parse_url"; - ParseURLParser(SerializedPlanParser * plan_parser) : FunctionParser(plan_parser) { } + ParseURLParser(SerializedPlanParser * plan_parser_) : FunctionParser(plan_parser_) { } ~ParseURLParser() override = default; String getName() const override { return name; } diff --git a/cpp-ch/local-engine/Rewriter/ExpressionRewriter.h b/cpp-ch/local-engine/Rewriter/ExpressionRewriter.h index 52b8e195f68a7..8c0bc0e0d9810 100644 --- a/cpp-ch/local-engine/Rewriter/ExpressionRewriter.h +++ b/cpp-ch/local-engine/Rewriter/ExpressionRewriter.h @@ -33,7 +33,7 @@ enum SelfDefinedFunctionReference class GetJsonObjectFunctionWriter : public RelRewriter { public: - GetJsonObjectFunctionWriter(SerializedPlanParser * parser) : RelRewriter(parser) {} + GetJsonObjectFunctionWriter(SerializedPlanParser * parser_) : RelRewriter(parser_) {} ~GetJsonObjectFunctionWriter() override = default; void rewrite(substrait::Rel & rel) override diff --git a/cpp-ch/local-engine/Shuffle/PartitionWriter.cpp b/cpp-ch/local-engine/Shuffle/PartitionWriter.cpp index e200e59ec302c..7a6bcb78ccf1c 100644 --- a/cpp-ch/local-engine/Shuffle/PartitionWriter.cpp +++ b/cpp-ch/local-engine/Shuffle/PartitionWriter.cpp @@ -177,8 +177,8 @@ std::vector LocalPartitionWriter::mergeSpills(WriteBuffer& data_file) } return partition_length; } -LocalPartitionWriter::LocalPartitionWriter(CachedShuffleWriter * shuffle_writer) - : PartitionWriter(shuffle_writer) +LocalPartitionWriter::LocalPartitionWriter(CachedShuffleWriter * shuffle_writer_) + : PartitionWriter(shuffle_writer_) { } String LocalPartitionWriter::getNextSpillFile() diff --git a/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.cpp b/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.cpp index 0e6b80c55c3b9..7aff8d2bf7c25 100644 --- a/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.cpp +++ b/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.cpp @@ -346,37 +346,37 @@ void ExcelTextFormatReader::skipRowEndDelimiter() skipEndOfLine(*buf); } -void ExcelTextFormatReader::skipEndOfLine(DB::ReadBuffer & in) +void ExcelTextFormatReader::skipEndOfLine(DB::ReadBuffer & readBuffer) { /// \n (Unix) or \r\n (DOS/Windows) or \n\r (Mac OS Classic) - if (*in.position() == '\n') + if (*readBuffer.position() == '\n') { - ++in.position(); - if (!in.eof() && *in.position() == '\r') - ++in.position(); + ++readBuffer.position(); + if (!readBuffer.eof() && *readBuffer.position() == '\r') + ++readBuffer.position(); } - else if (*in.position() == '\r') + else if (*readBuffer.position() == '\r') { - ++in.position(); - if (!in.eof() && *in.position() == '\n') - ++in.position(); + ++readBuffer.position(); + if (!readBuffer.eof() && *readBuffer.position() == '\n') + ++readBuffer.position(); /// Different with CH master: /// removed \r check } - else if (!in.eof()) + else if (!readBuffer.eof()) throw DB::Exception(DB::ErrorCodes::INCORRECT_DATA, "Expected end of line"); } -inline void ExcelTextFormatReader::skipWhitespacesAndTabs(ReadBuffer & in, bool allow_whitespace_or_tab_as_delimiter) +inline void ExcelTextFormatReader::skipWhitespacesAndTabs(ReadBuffer & readBuffer, bool allow_whitespace_or_tab_as_delimiter) { if (allow_whitespace_or_tab_as_delimiter) { return; } - /// Skip `whitespace` symbols allowed in CSV. - while (!in.eof() && (*in.position() == ' ' || *in.position() == '\t')) - ++in.position(); + /// Skip `whitespace` symbols allowed readBuffer CSV. + while (!readBuffer.eof() && (*readBuffer.position() == ' ' || *readBuffer.position() == '\t')) + ++readBuffer.position(); } diff --git a/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.h b/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.h index b6046a74369e2..c55cdff011868 100644 --- a/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.h +++ b/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.h @@ -79,8 +79,8 @@ class ExcelTextFormatReader final : public DB::CSVFormatReader private: void preSkipNullValue(); bool isEndOfLine(); - static void skipEndOfLine(DB::ReadBuffer & in); - static void skipWhitespacesAndTabs(DB::ReadBuffer & in, bool allow_whitespace_or_tab_as_delimiter); + static void skipEndOfLine(DB::ReadBuffer & readBuffer); + static void skipWhitespacesAndTabs(DB::ReadBuffer & readBuffer, bool allow_whitespace_or_tab_as_delimiter); std::vector input_field_names; diff --git a/cpp-ch/local-engine/proto/CMakeLists.txt b/cpp-ch/local-engine/proto/CMakeLists.txt index 055436b6fc32e..61ed2b15b5b21 100644 --- a/cpp-ch/local-engine/proto/CMakeLists.txt +++ b/cpp-ch/local-engine/proto/CMakeLists.txt @@ -35,7 +35,7 @@ set_source_files_properties(${SUBSTRAIT_SRCS} PROPERTIES GENERATED TRUE) add_library(substrait ${SUBSTRAIT_SRCS}) add_dependencies(substrait generate_substrait) -target_compile_options(substrait PUBLIC -fPIC -Wno-reserved-identifier -Wno-deprecated -Wno-shadow-field) +target_compile_options(substrait PUBLIC -fPIC -Wno-reserved-identifier -Wno-deprecated) target_include_directories(substrait SYSTEM BEFORE PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(substrait ch_contrib::protobuf)