From 4aeadf3967c0e6f8772be6a4e14a6877391fd265 Mon Sep 17 00:00:00 2001 From: taiyang-li <654010905@qq.com> Date: Wed, 1 Dec 2021 14:13:48 +0800 Subject: [PATCH] fix build error --- src/Formats/registerFormats.cpp | 5 +++++ src/IO/RemoteReadBufferCache.cpp | 7 ++++--- src/IO/RemoteReadBufferCache.h | 6 +++--- src/Processors/Formats/Impl/HiveTextRowInputFormat.cpp | 1 + 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Formats/registerFormats.cpp b/src/Formats/registerFormats.cpp index a616cb275e0..023161a47f3 100644 --- a/src/Formats/registerFormats.cpp +++ b/src/Formats/registerFormats.cpp @@ -76,7 +76,10 @@ void registerInputFormatRegexp(FormatFactory & factory); void registerInputFormatJSONAsString(FormatFactory & factory); void registerInputFormatLineAsString(FormatFactory & factory); void registerInputFormatCapnProto(FormatFactory & factory); + +#if USE_HIVE void registerInputFormatHiveText(FormatFactory & factory); +#endif /// Non trivial prefix and suffix checkers for disabling parallel parsing. void registerNonTrivialPrefixAndSuffixCheckerJSONEachRow(FormatFactory & factory); @@ -148,7 +151,9 @@ void registerFormats() registerInputFormatRegexp(factory); registerInputFormatJSONAsString(factory); registerInputFormatLineAsString(factory); +#if USE_HIVE registerInputFormatHiveText(factory); +#endif registerInputFormatCapnProto(factory); diff --git a/src/IO/RemoteReadBufferCache.cpp b/src/IO/RemoteReadBufferCache.cpp index 78d1e31b040..acee2484e7e 100644 --- a/src/IO/RemoteReadBufferCache.cpp +++ b/src/IO/RemoteReadBufferCache.cpp @@ -29,7 +29,7 @@ namespace ErrorCodes bool RemoteFileMetadata::load(const std::filesystem::path & local_path) { - auto log = &Poco::Logger::get("RemoteFileMetadata"); + auto * log = &Poco::Logger::get("RemoteFileMetadata"); if (!std::filesystem::exists(local_path)) { LOG_ERROR(log, "file path not exists:{}", local_path.string()); @@ -49,13 +49,14 @@ bool RemoteFileMetadata::load(const std::filesystem::path & local_path) return true; } -void RemoteFileMetadata::save(const std::filesystem::path & local_path) +void RemoteFileMetadata::save(const std::filesystem::path & local_path) const { std::ofstream meta_file(local_path.string(), std::ios::out); meta_file << toString(); meta_file.close(); } -String RemoteFileMetadata::toString() + +String RemoteFileMetadata::toString() const { Poco::JSON::Object jobj; jobj.set("schema", schema); diff --git a/src/IO/RemoteReadBufferCache.h b/src/IO/RemoteReadBufferCache.h index c0c39e663b4..34eed7f6dc1 100644 --- a/src/IO/RemoteReadBufferCache.h +++ b/src/IO/RemoteReadBufferCache.h @@ -49,8 +49,8 @@ struct RemoteFileMetadata } bool load(const std::filesystem::path & local_path); - void save(const std::filesystem::path & local_path); - String toString(); + void save(const std::filesystem::path & local_path) const; + String toString() const; String schema; // Hive, S2 etc. String cluster; @@ -103,7 +103,7 @@ public: inline size_t size() const { return current_offset; } inline const std::filesystem::path & getLocalPath() { return local_path; } - inline const String & getRemotePath() { return file_meta_data.remote_path; } + inline const String & getRemotePath() const { return file_meta_data.remote_path; } inline UInt64 getLastModificationTimestamp() const { return file_meta_data.last_modification_timestamp; } inline void markInvalid() diff --git a/src/Processors/Formats/Impl/HiveTextRowInputFormat.cpp b/src/Processors/Formats/Impl/HiveTextRowInputFormat.cpp index d300a8d1727..8500962be75 100644 --- a/src/Processors/Formats/Impl/HiveTextRowInputFormat.cpp +++ b/src/Processors/Formats/Impl/HiveTextRowInputFormat.cpp @@ -1,6 +1,7 @@ #include #if USE_HIVE + namespace DB {