File tree Expand file tree Collapse file tree 5 files changed +24
-0
lines changed
presto-native-execution/presto_cpp/main Expand file tree Collapse file tree 5 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ target_link_libraries(
6464 velox_dwio_orc_reader
6565 velox_dwio_parquet_reader
6666 velox_dwio_parquet_writer
67+ velox_dwio_text_writer_register
6768 velox_dynamic_library_loader
6869 velox_encode
6970 velox_exec
Original file line number Diff line number Diff line change 5858#include " velox/dwio/orc/reader/OrcReader.h"
5959#include " velox/dwio/parquet/RegisterParquetReader.h"
6060#include " velox/dwio/parquet/RegisterParquetWriter.h"
61+ #include " velox/dwio/text/RegisterTextWriter.h"
6162#include " velox/exec/OutputBufferManager.h"
6263#include " velox/functions/prestosql/aggregates/RegisterAggregateFunctions.h"
6364#include " velox/functions/prestosql/registration/RegistrationFunctions.h"
@@ -1399,13 +1400,19 @@ void PrestoServer::registerFileReadersAndWriters() {
13991400 velox::orc::registerOrcReaderFactory ();
14001401 velox::parquet::registerParquetReaderFactory ();
14011402 velox::parquet::registerParquetWriterFactory ();
1403+ if (SystemConfig::instance ()->textWriterEnabled ()) {
1404+ velox::text::registerTextWriterFactory ();
1405+ }
14021406}
14031407
14041408void PrestoServer::unregisterFileReadersAndWriters () {
14051409 velox::dwrf::unregisterDwrfReaderFactory ();
14061410 velox::dwrf::unregisterDwrfWriterFactory ();
14071411 velox::parquet::unregisterParquetReaderFactory ();
14081412 velox::parquet::unregisterParquetWriterFactory ();
1413+ if (SystemConfig::instance ()->textWriterEnabled ()) {
1414+ velox::text::unregisterTextWriterFactory ();
1415+ }
14091416}
14101417
14111418void PrestoServer::registerStatsCounters () {
Original file line number Diff line number Diff line change @@ -265,6 +265,7 @@ SystemConfig::SystemConfig() {
265265 NUM_PROP (kExchangeIoEvbViolationThresholdMs , 1000 ),
266266 NUM_PROP (kHttpSrvIoEvbViolationThresholdMs , 1000 ),
267267 NUM_PROP (kMaxLocalExchangePartitionBufferSize , 65536 ),
268+ BOOL_PROP (kTextWriterEnabled , false ),
268269 };
269270}
270271
@@ -919,6 +920,10 @@ uint64_t SystemConfig::maxLocalExchangePartitionBufferSize() const {
919920 return optionalProperty<uint64_t >(kMaxLocalExchangePartitionBufferSize ).value ();
920921}
921922
923+ bool SystemConfig::textWriterEnabled () const {
924+ return optionalProperty<bool >(kTextWriterEnabled ).value ();
925+ }
926+
922927NodeConfig::NodeConfig () {
923928 registeredProps_ =
924929 std::unordered_map<std::string, folly::Optional<std::string>>{
Original file line number Diff line number Diff line change @@ -763,6 +763,11 @@ class SystemConfig : public ConfigBase {
763763 static constexpr std::string_view kMaxLocalExchangePartitionBufferSize {
764764 " local-exchange.max-partition-buffer-size" };
765765
766+ // Add to temporarily help with gradual rollout for text writer
767+ // TODO: remove once text writer is fully rolled out
768+ static constexpr std::string_view kTextWriterEnabled {
769+ " text-writer-enabled" };
770+
766771 SystemConfig ();
767772
768773 virtual ~SystemConfig () = default ;
@@ -1047,6 +1052,8 @@ class SystemConfig : public ConfigBase {
10471052 int32_t httpSrvIoEvbViolationThresholdMs () const ;
10481053
10491054 uint64_t maxLocalExchangePartitionBufferSize () const ;
1055+
1056+ bool textWriterEnabled () const ;
10501057};
10511058
10521059// / Provides access to node properties defined in node.properties file.
Original file line number Diff line number Diff line change 2020#include " presto_cpp/presto_protocol/connector/tpch/TpchConnectorProtocol.h"
2121
2222#include < velox/type/fbhive/HiveTypeParser.h>
23+
24+ #include " presto_cpp/main/common/Configs.h"
2325#include " velox/connectors/hive/HiveConnector.h"
2426#include " velox/connectors/hive/HiveConnectorSplit.h"
2527#include " velox/connectors/hive/HiveDataSink.h"
@@ -910,6 +912,8 @@ dwio::common::FileFormat toFileFormat(
910912 case protocol::hive::HiveStorageFormat::ALPHA:
911913 // This has been renamed in Velox from ALPHA to NIMBLE.
912914 return dwio::common::FileFormat::NIMBLE;
915+ case protocol::hive::HiveStorageFormat::TEXTFILE:
916+ return dwio::common::FileFormat::TEXT;
913917 default :
914918 VELOX_UNSUPPORTED (
915919 " Unsupported file format in {}: {}." ,
You can’t perform that action at this time.
0 commit comments