Skip to content

Commit

Permalink
Revert apache#1837 since
Browse files Browse the repository at this point in the history
ClickHouse/ClickHouse#56014.

Fix build due to removing -Wno-shadow-field
  • Loading branch information
baibaichen committed Oct 26, 2023
1 parent 2e7c88c commit 86252f3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down
2 changes: 1 addition & 1 deletion cpp-ch/local-engine/Rewriter/ExpressionRewriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cpp-ch/local-engine/Shuffle/PartitionWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ std::vector<Int64> 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> input_field_names;
Expand Down
2 changes: 1 addition & 1 deletion cpp-ch/local-engine/proto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 86252f3

Please sign in to comment.