diff --git a/be/src/exec/orc_scanner.cpp b/be/src/exec/orc_scanner.cpp index 847b465343ca2f..30954526b5dbd6 100644 --- a/be/src/exec/orc_scanner.cpp +++ b/be/src/exec/orc_scanner.cpp @@ -27,6 +27,20 @@ #include "runtime/runtime_state.h" #include "runtime/tuple.h" +// orc include file didn't expose orc::TimezoneError +// we have to declare it by hand, following is the source code in orc link +// https://github.com/apache/orc/blob/84353fbfc447b06e0924024a8e03c1aaebd3e7a5/c%2B%2B/src/Timezone.hh#L104-L109 +namespace orc { + +class TimezoneError: public std::runtime_error { +public: + TimezoneError(const std::string& what); + TimezoneError(const TimezoneError&); + virtual ~TimezoneError() noexcept; +}; + +} + namespace doris { class ORCFileStream : public orc::InputStream { @@ -341,6 +355,11 @@ Status ORCScanner::get_next(Tuple* tuple, MemPool* tuple_pool, bool* eof) { str_error << "ParseError : " << e.what(); LOG(WARNING) << str_error.str(); return Status::InternalError(str_error.str()); + } catch (orc::TimezoneError& e) { + std::stringstream str_error; + str_error << "TimezoneError : " << e.what(); + LOG(WARNING) << str_error.str(); + return Status::InternalError(str_error.str()); } } diff --git a/be/src/exec/orc_scanner.h b/be/src/exec/orc_scanner.h index 9839fb110947f5..85a5e883c7a00b 100644 --- a/be/src/exec/orc_scanner.h +++ b/be/src/exec/orc_scanner.h @@ -19,6 +19,7 @@ #define ORC_SCANNER_H #include + #include "exec/base_scanner.h" namespace doris {