Details
-
Wish
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
0.14.2
-
None
-
None
Description
In Parquet C++, we would like to make use of the new TConfiguration introduced in 0.14.0. However, we also want our source code to be compatible with previous versions. It would be made greatly easier if we could do that using preprocessor directives, such as:
uint8_t* buf = ...; unt32_t len = ...; std::shared_ptr<ThriftBuffer> mem_transport; #if THRIFT_VERSION_MAJOR > 0 || THRIFT_VERSION_MINOR >= 14 auto config = std::make_shared<TConfiguration>(); config->setMaxMessageSize(...); mem_transport = std::make_shared<TMemoryBuffer>( buf, len, TMemoryBuffer::OBSERVE, config); #else mem_transport = std::make_shared<TMemoryBuffer>(buf, len); #endif
However, given that the C++ library doesn't seem to expose such constants, we're going to need to run custom tests during the configuration step to find out whether TConfiguration is available...