velox icon indicating copy to clipboard operation
velox copied to clipboard

Build fail in presto-native-execution when PRESTO_ENABLE_PARQUET = ON caused by undefined thrift liked symbols

Open Dream-hu opened this issue 2 years ago • 3 comments

it seems like arrow/thrift and fbthrift are mixed up,details:

Linking CXX executable presto_cpp/main/presto_server failed: Undefined symbols for architecture arm64: "apache::thrift::CodecConfig::__fbthrift_clear()", referenced from: apache::thrift::CodecConfig::~CodecConfig() in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) apache::thrift::CodecConfig::~CodecConfig() in libthriftcpp2.a(Cpp2Channel.cpp.o) apache::thrift::CodecConfig::~CodecConfig() in libthriftcpp2.a(RequestChannel.cpp.o) apache::thrift::CodecConfig::~CodecConfig() in libthriftcpp2.a(FramingHandler.cpp.o) apache::thrift::CodecConfig::~CodecConfig() in libthriftcpp2.a(RpcMetadataUtil.cpp.o) "apache::thrift::concurrency::Util::currentTimeTicks(long long)", referenced from: apache::thrift::concurrency::Util::currentTime() in libtransport.a(THttpParser.cpp.o) "apache::thrift::ContextStack::onReadData(apache::thrift::SerializedMessage const&)", referenced from: folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped_helper<apache::thrift::BinaryProtocolReader, apache::thrift::ThriftPresult >(apache::thrift::BinaryProtocolReader*, apache::thrift::ClientReceiveState&, apache::thrift::ThriftPresult&) in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped_helper<apache::thrift::CompactProtocolReader, apache::thrift::ThriftPresult >(apache::thrift::CompactProtocolReader*, apache::thrift::ClientReceiveState&, apache::thrift::ThriftPresult&) in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) "apache::thrift::ContextStack::onWriteData(apache::thrift::SerializedMessage const&)", referenced from: apache::thrift::SerializedRequest apache::thrift::preprocessSendTapache::thrift::BinaryProtocolWriter(apache::thrift::BinaryProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack*, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::BinaryProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::BinaryProtocolWriter*)>, unsigned long long)::'lambda'()::operator()() const in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) apache::thrift::SerializedRequest apache::thrift::preprocessSendTapache::thrift::CompactProtocolWriter(apache::thrift::CompactProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack*, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::CompactProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::CompactProtocolWriter*)>, unsigned long long)::'lambda'()::operator()() const in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) "apache::thrift::ContextStack::handlerErrorWrapped(folly::exception_wrapper const&)", referenced from: folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped<apache::thrift::ThriftPresult, apache::thrift::BinaryProtocolReader>(apache::thrift::BinaryProtocolReader*, apache::thrift::ClientReceiveState&) in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped<apache::thrift::ThriftPresult, apache::thrift::CompactProtocolReader>(apache::thrift::CompactProtocolReader*, apache::thrift::ClientReceiveState&) in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) apache::thrift::SerializedRequest apache::thrift::preprocessSendTapache::thrift::BinaryProtocolWriter(apache::thrift::BinaryProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack*, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::BinaryProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::BinaryProtocolWriter*)>, unsigned long long)::'lambda'()::operator()() const in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) apache::thrift::SerializedRequest apache::thrift::preprocessSendTapache::thrift::CompactProtocolWriter(apache::thrift::CompactProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack*, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::CompactProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::CompactProtocolWriter*)>, unsigned long long)::'lambda'()::operator()() const in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) apache::thrift::detail::ap::helper<apache::thrift::BinaryProtocolReader, apache::thrift::BinaryProtocolWriter>::write_exn(bool, char const*, apache::thrift::BinaryProtocolWriter*, int, apache::thrift::ContextStack*, apache::thrift::TApplicationException const&) in libthriftcpp2.a(GeneratedCodeHelper.cpp.o) apache::thrift::detail::ap::helper<apache::thrift::CompactProtocolReader, apache::thrift::CompactProtocolWriter>::write_exn(bool, char const*, apache::thrift::CompactProtocolWriter*, int, apache::thrift::ContextStack*, apache::thrift::TApplicationException const&) in libthriftcpp2.a(GeneratedCodeHelper.cpp.o) "apache::thrift::ContextStack::createWithClientContext(std::__1::shared_ptr<std::__1::vector<std::__1::shared_ptrapache::thrift::TProcessorEventHandler, std::__1::allocator<std::__1::shared_ptrapache::thrift::TProcessorEventHandler > > > const&, char const*, char const*, apache::thrift::transport::THeader&)", referenced from: apache::thrift::Clientfacebook::presto::thrift::PrestoThrift::fakeCtx(apache::thrift::RpcOptions*) in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) "apache::thrift::ContextStack::resetClientRequestContextHeader()", referenced from: apache::thrift::SerializedRequest apache::thrift::preprocessSendTapache::thrift::BinaryProtocolWriter(apache::thrift::BinaryProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack*, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::BinaryProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::BinaryProtocolWriter*)>, unsigned long long)::'lambda'()::operator()() const in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) apache::thrift::SerializedRequest apache::thrift::preprocessSendTapache::thrift::CompactProtocolWriter(apache::thrift::CompactProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack*, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::CompactProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::CompactProtocolWriter*)>, unsigned long long)::'lambda'()::operator()() const in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) "apache::thrift::ContextStack::preRead()", referenced from: folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped_helper<apache::thrift::BinaryProtocolReader, apache::thrift::ThriftPresult >(apache::thrift::BinaryProtocolReader*, apache::thrift::ClientReceiveState&, apache::thrift::ThriftPresult&) in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped_helper<apache::thrift::CompactProtocolReader, apache::thrift::ThriftPresult >(apache::thrift::CompactProtocolReader*, apache::thrift::ClientReceiveState&, apache::thrift::ThriftPresult&) in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) "apache::thrift::ContextStack::postRead(apache::thrift::transport::THeader*, unsigned int)", referenced from: folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped_helper<apache::thrift::BinaryProtocolReader, apache::thrift::ThriftPresult >(apache::thrift::BinaryProtocolReader*, apache::thrift::ClientReceiveState&, apache::thrift::ThriftPresult&) in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped_helper<apache::thrift::CompactProtocolReader, apache::thrift::ThriftPresult >(apache::thrift::CompactProtocolReader*, apache::thrift::ClientReceiveState&, apache::thrift::ThriftPresult&) in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) "apache::thrift::ContextStack::preWrite()", referenced from: apache::thrift::SerializedRequest apache::thrift::preprocessSendTapache::thrift::BinaryProtocolWriter(apache::thrift::BinaryProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack*, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::BinaryProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::BinaryProtocolWriter*)>, unsigned long long)::'lambda'()::operator()() const in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) apache::thrift::SerializedRequest apache::thrift::preprocessSendTapache::thrift::CompactProtocolWriter(apache::thrift::CompactProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack*, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::CompactProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::CompactProtocolWriter*)>, unsigned long long)::'lambda'()::operator()() const in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) "apache::thrift::ContextStack::postWrite(unsigned int)", referenced from: apache::thrift::SerializedRequest apache::thrift::preprocessSendTapache::thrift::BinaryProtocolWriter(apache::thrift::BinaryProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack*, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::BinaryProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::BinaryProtocolWriter*)>, unsigned long long)::'lambda'()::operator()() const in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) apache::thrift::SerializedRequest apache::thrift::preprocessSendTapache::thrift::CompactProtocolWriter(apache::thrift::CompactProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack*, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::CompactProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::CompactProtocolWriter*)>, unsigned long long)::'lambda'()::operator()() const in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) "void apache::thrift::ClientMetadata::readNoXferapache::thrift::SimpleJSONProtocolReader(apache::thrift::SimpleJSONProtocolReader*)", referenced from: void apache::thrift::Cpp2Ops<apache::thrift::ClientMetadata, void>::readapache::thrift::SimpleJSONProtocolReader(apache::thrift::SimpleJSONProtocolReader*, apache::thrift::ClientMetadata*) in libtransport.a(THeader.cpp.o) "apache::thrift::ClientMetadata::ClientMetadata(apache::thrift::ClientMetadata&&)", referenced from: std::__1::__optional_destruct_base<apache::thrift::ClientMetadata, false>::__optional_destruct_baseapache::thrift::ClientMetadata(std::__1::in_place_t, apache::thrift::ClientMetadata&&) in libtransport.a(THeader.cpp.o) "apache::thrift::PayloadMetadata::__fbthrift_clear()", referenced from: apache::thrift::PayloadMetadata::~PayloadMetadata() in libthriftcpp2.a(ClientSinkBridge.cpp.o) apache::thrift::PayloadMetadata::~PayloadMetadata() in libthriftcpp2.a(ClientStreamBridge.cpp.o) "apache::thrift::CompressionConfig::CompressionConfig(apache::thrift::CompressionConfig const&)", referenced from: void folly::Optionalapache::thrift::CompressionConfig::construct<apache::thrift::CompressionConfig const&>(apache::thrift::CompressionConfig const&) in libthriftcpp2.a(RpcMetadataUtil.cpp.o) "apache::thrift::CompressionConfig::operator=(apache::thrift::CompressionConfig const&)", referenced from: apache::thrift::detail::makeRequestRpcMetadata(apache::thrift::RpcOptions const&, apache::thrift::RpcKind, apache::thrift::ProtocolId, apache::thrift::ManagedStringView&&, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >, apache::thrift::transport::THeader&) in libthriftcpp2.a(RpcMetadataUtil.cpp.o) "apache::thrift::RequestRpcMetadata::RequestRpcMetadata()", referenced from: apache::thrift::detail::makeRequestRpcMetadata(apache::thrift::RpcOptions const&, apache::thrift::RpcKind, apache::thrift::ProtocolId, apache::thrift::ManagedStringView&&, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >, apache::thrift::transport::THeader&) in libthriftcpp2.a(RpcMetadataUtil.cpp.o) "apache::thrift::RequestRpcMetadata::~RequestRpcMetadata()", referenced from: apache::thrift::detail::makeRequestRpcMetadata(apache::thrift::RpcOptions const&, apache::thrift::RpcKind, apache::thrift::ProtocolId, apache::thrift::ManagedStringView&&, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >, apache::thrift::transport::THeader&) in libthriftcpp2.a(RpcMetadataUtil.cpp.o) "void apache::thrift::ErrorClassification::readNoXferapache::thrift::CompactProtocolReader(apache::thrift::CompactProtocolReader*)", referenced from: void apache::thrift::Cpp2Ops<apache::thrift::ErrorClassification, void>::readapache::thrift::CompactProtocolReader(apache::thrift::CompactProtocolReader*, apache::thrift::ErrorClassification*) in libthriftcpp2.a(RpcMetadataUtil.cpp.o) "apache::thrift::StreamPayloadMetadata::StreamPayloadMetadata(apache::thrift::StreamPayloadMetadata&&)", referenced from: apache::thrift::StreamPayload::StreamPayload(std::__1::unique_ptr<folly::IOBuf, std::__1::default_deletefolly::IOBuf >, apache::thrift::StreamPayloadMetadata&&, bool) in libthriftcpp2.a(ClientStreamBridge.cpp.o) "apache::thrift::StreamPayloadMetadata::StreamPayloadMetadata(apache::thrift::StreamPayloadMetadata const&)", referenced from: apache::thrift::StreamPayload::StreamPayload(apache::thrift::StreamPayload const&) in libthriftcpp2.a(ClientSinkBridge.cpp.o) apache::thrift::StreamPayload::StreamPayload(apache::thrift::StreamPayload const&) in libthriftcpp2.a(ClientStreamBridge.cpp.o) "unsigned int apache::thrift::ClientMetadata::writeapache::thrift::SimpleJSONProtocolWriter(apache::thrift::SimpleJSONProtocolWriter*) const", referenced from: unsigned int apache::thrift::Cpp2Ops<apache::thrift::ClientMetadata, void>::writeapache::thrift::SimpleJSONProtocolWriter(apache::thrift::SimpleJSONProtocolWriter*, apache::thrift::ClientMetadata const*) in libtransport.a(THeader.cpp.o) "unsigned int apache::thrift::ErrorClassification::writeapache::thrift::CompactProtocolWriter(apache::thrift::CompactProtocolWriter*) const", referenced from: unsigned int apache::thrift::Cpp2Ops<apache::thrift::ErrorClassification, void>::writeapache::thrift::CompactProtocolWriter(apache::thrift::CompactProtocolWriter*, apache::thrift::ErrorClassification const*) in libthriftcpp2.a(RpcMetadataUtil.cpp.o) "std::__1::default_deleteapache::thrift::ContextStack::operator()(apache::thrift::ContextStack*) const", referenced from: std::__1::unique_ptr<apache::thrift::ContextStack, std::__1::default_deleteapache::thrift::ContextStack >::reset(apache::thrift::ContextStack*) in libpresto_thrift-cpp2.a(PrestoThriftAsyncClient.cpp.o) std::__1::unique_ptr<apache::thrift::ContextStack, std::__1::default_deleteapache::thrift::ContextStack >::reset(apache::thrift::ContextStack*) in libthriftcpp2.a(RequestChannel.cpp.o) ld: symbol(s) not found for architecture arm64

Dream-hu avatar Oct 20 '22 04:10 Dream-hu

addition:presto_server(parquet off) has not used the undefined symbol like "apache::thrift::CodecConfig::__fbthrift_clear()"

nm presto_server| grep "fbthrift_clear" 00000001038e6828 t __ZN8facebook6presto6thrift10TaskStatus16__fbthrift_clearEv 00000001038da810 t __ZN8facebook6presto6thrift10TaskStatus29__fbthrift_clear_terse_fieldsEv 00000001038d67e8 t __ZN8facebook6presto6thrift11HostAddress16__fbthrift_clearEv 00000001038d46f0 t __ZN8facebook6presto6thrift11HostAddress29__fbthrift_clear_terse_fieldsEv 00000001038d2e9c t __ZN8facebook6presto6thrift13ErrorLocation16__fbthrift_clearEv 00000001038d1208 t __ZN8facebook6presto6thrift13ErrorLocation29__fbthrift_clear_terse_fieldsEv 00000001038fcc48 t __ZN8facebook6presto6thrift20ExecutionFailureInfo16__fbthrift_clearEv 00000001038f5e48 t __ZN8facebook6presto6thrift20ExecutionFailureInfo29__fbthrift_clear_terse_fieldsEv 00000001038cf780 t __ZN8facebook6presto6thrift8Lifespan16__fbthrift_clearEv 00000001038cd220 t __ZN8facebook6presto6thrift8Lifespan29__fbthrift_clear_terse_fieldsEv 00000001038f2c70 t __ZN8facebook6presto6thrift9ErrorCode16__fbthrift_clearEv 00000001038f01ec t __ZN8facebook6presto6thrift9ErrorCode29__fbthrift_clear_terse_fieldsEv

Dream-hu avatar Oct 20 '22 07:10 Dream-hu

cc : @Yuhta , @yingsu00 .

Hi @Dream-hu , Not really certain if the problem is on Velox end, can you also raise this issue on presto-native and see what they say. As Velox only has this indirect dependency on thrift due to arrow/parquet, it seems this issue is more pertinent to presto-native.

kgpai avatar Oct 20 '22 15:10 kgpai

You need to build velox and presto_cpp as 2 separate .so if you want to enable parquet support. I remember @majetideepak has made it work, @majetideepak would you provide some details here?

Yuhta avatar Oct 20 '22 15:10 Yuhta

@Yuhta, I could not get this to work. I explored the option to use fbthrift for Parquet also, but both Arrow and Velox check-in thrift generated cpp files that are not compatible with fbthrift.

Also, this is a duplicate of https://github.com/prestodb/presto/issues/18261. Let's keep all the discussions in one place. Closing this.

majetideepak avatar Oct 21 '22 19:10 majetideepak