File tree Expand file tree Collapse file tree 7 files changed +176
-94
lines changed Expand file tree Collapse file tree 7 files changed +176
-94
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,13 @@ bool HiveConfig::readStatsBasedFilterReorderDisabled(
230
230
config_->get <bool >(kReadStatsBasedFilterReorderDisabled , false ));
231
231
}
232
232
233
+ bool HiveConfig::isRequestedTypeCheckEnabled (
234
+ const config::ConfigBase* session) const {
235
+ return session->get <bool >(
236
+ kEnableRequestedTypeCheckSession ,
237
+ config_->get <bool >(kEnableRequestedTypeCheck , true ));
238
+ }
239
+
233
240
std::string HiveConfig::hiveLocalDataPath () const {
234
241
return config_->get <std::string>(kLocalDataPath , " " );
235
242
}
Original file line number Diff line number Diff line change @@ -187,6 +187,11 @@ class HiveConfig {
187
187
static constexpr const char * kLocalDataPath = " hive_local_data_path" ;
188
188
static constexpr const char * kLocalFileFormat = " hive_local_file_format" ;
189
189
190
+ static constexpr const char * kEnableRequestedTypeCheck =
191
+ " enable-requested-type-check" ;
192
+ static constexpr const char * kEnableRequestedTypeCheckSession =
193
+ " enable_requested_type_check" ;
194
+
190
195
InsertExistingPartitionsBehavior insertExistingPartitionsBehavior (
191
196
const config::ConfigBase* session) const ;
192
197
@@ -258,6 +263,10 @@ class HiveConfig {
258
263
bool readStatsBasedFilterReorderDisabled (
259
264
const config::ConfigBase* session) const ;
260
265
266
+ // / Whether to enable requested type check in the ReaderBase::convertType.
267
+ // / Returns true by default.
268
+ bool isRequestedTypeCheckEnabled (const config::ConfigBase* session) const ;
269
+
261
270
// / Returns the file system path containing local data. If non-empty,
262
271
// / initializes LocalHiveConnectorMetadata to provide metadata for the tables
263
272
// / in the directory.
Original file line number Diff line number Diff line change @@ -604,6 +604,8 @@ void configureReaderOptions(
604
604
}
605
605
606
606
readerOptions.setFileFormat (hiveSplit->fileFormat );
607
+ readerOptions.setEnableRequestedTypeCheck (
608
+ hiveConfig->isRequestedTypeCheckEnabled (sessionProperties));
607
609
}
608
610
}
609
611
Original file line number Diff line number Diff line change @@ -664,6 +664,11 @@ Each query can override the config by setting corresponding query session proper
664
664
- bool
665
665
- true
666
666
- Reads timestamp partition value as local time if true. Otherwise, reads as UTC.
667
+ * - enable-requested-type-check
668
+ - enable_requested_type_check
669
+ - bool
670
+ - true
671
+ - Whether to enable requested type check in the `ReaderBase::convertType `. True by default.
667
672
668
673
``ORC File Format Configuration ``
669
674
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -600,6 +600,10 @@ class ReaderOptions : public io::ReaderOptions {
600
600
return randomSkip_;
601
601
}
602
602
603
+ bool enableRequestedTypeCheck () const {
604
+ return enableRequestedTypeCheck_;
605
+ }
606
+
603
607
void setRandomSkip (std::shared_ptr<random::RandomSkipTracker> randomSkip) {
604
608
randomSkip_ = std::move (randomSkip);
605
609
}
@@ -636,6 +640,10 @@ class ReaderOptions : public io::ReaderOptions {
636
640
allowEmptyFile_ = value;
637
641
}
638
642
643
+ void setEnableRequestedTypeCheck (bool enableRequestedTypeCheck) {
644
+ enableRequestedTypeCheck_ = enableRequestedTypeCheck;
645
+ }
646
+
639
647
private:
640
648
uint64_t tailLocation_;
641
649
FileFormat fileFormat_;
@@ -653,6 +661,7 @@ class ReaderOptions : public io::ReaderOptions {
653
661
bool adjustTimestampToTimezone_{false };
654
662
bool selectiveNimbleReaderEnabled_{false };
655
663
bool allowEmptyFile_{false };
664
+ bool enableRequestedTypeCheck_{true };
656
665
};
657
666
658
667
struct WriterOptions {
You can’t perform that action at this time.
0 commit comments