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"
@@ -1413,13 +1414,19 @@ void PrestoServer::registerFileReadersAndWriters() {
14131414 velox::orc::registerOrcReaderFactory ();
14141415 velox::parquet::registerParquetReaderFactory ();
14151416 velox::parquet::registerParquetWriterFactory ();
1417+ if (SystemConfig::instance ()->textWriterEnabled ()) {
1418+ velox::text::registerTextWriterFactory ();
1419+ }
14161420}
14171421
14181422void PrestoServer::unregisterFileReadersAndWriters () {
14191423 velox::dwrf::unregisterDwrfReaderFactory ();
14201424 velox::dwrf::unregisterDwrfWriterFactory ();
14211425 velox::parquet::unregisterParquetReaderFactory ();
14221426 velox::parquet::unregisterParquetWriterFactory ();
1427+ if (SystemConfig::instance ()->textWriterEnabled ()) {
1428+ velox::text::unregisterTextWriterFactory ();
1429+ }
14231430}
14241431
14251432void 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"
@@ -1139,6 +1141,8 @@ dwio::common::FileFormat toFileFormat(
11391141 case protocol::hive::HiveStorageFormat::ALPHA:
11401142 // This has been renamed in Velox from ALPHA to NIMBLE.
11411143 return dwio::common::FileFormat::NIMBLE;
1144+ case protocol::hive::HiveStorageFormat::TEXTFILE:
1145+ return dwio::common::FileFormat::TEXT;
11421146 default :
11431147 VELOX_UNSUPPORTED (
11441148 " Unsupported file format in {}: {}." ,
You can’t perform that action at this time.
0 commit comments