@@ -50,6 +50,7 @@ public class ParquetReaderConfig {
50
50
private boolean enableTimeReadCounter = false ;
51
51
private boolean autoCorrectCorruptedDates = true ;
52
52
private boolean enableStringsSignedMinMax = false ;
53
+ private long timeoutPerRunnableInMsec = 15_000 ;
53
54
54
55
public static ParquetReaderConfig .Builder builder () {
55
56
return new ParquetReaderConfig .Builder ();
@@ -64,12 +65,15 @@ public ParquetReaderConfig(@JsonProperty("enableBytesReadCounter") Boolean enabl
64
65
@ JsonProperty ("enableBytesTotalCounter" ) Boolean enableBytesTotalCounter ,
65
66
@ JsonProperty ("enableTimeReadCounter" ) Boolean enableTimeReadCounter ,
66
67
@ JsonProperty ("autoCorrectCorruptedDates" ) Boolean autoCorrectCorruptedDates ,
67
- @ JsonProperty ("enableStringsSignedMinMax" ) Boolean enableStringsSignedMinMax ) {
68
+ @ JsonProperty ("enableStringsSignedMinMax" ) Boolean enableStringsSignedMinMax ,
69
+ @ JsonProperty ("timeoutPerRunnableInMsec" ) Long timeoutPerRunnableInMsec ) {
68
70
this .enableBytesReadCounter = enableBytesReadCounter == null ? this .enableBytesReadCounter : enableBytesReadCounter ;
69
71
this .enableBytesTotalCounter = enableBytesTotalCounter == null ? this .enableBytesTotalCounter : enableBytesTotalCounter ;
70
72
this .enableTimeReadCounter = enableTimeReadCounter == null ? this .enableTimeReadCounter : enableTimeReadCounter ;
71
73
this .autoCorrectCorruptedDates = autoCorrectCorruptedDates == null ? this .autoCorrectCorruptedDates : autoCorrectCorruptedDates ;
72
74
this .enableStringsSignedMinMax = enableStringsSignedMinMax == null ? this .enableStringsSignedMinMax : enableStringsSignedMinMax ;
75
+ this .timeoutPerRunnableInMsec = timeoutPerRunnableInMsec == null || Long .valueOf (timeoutPerRunnableInMsec ) <= 0 ? // zero means: use default
76
+ this .timeoutPerRunnableInMsec : timeoutPerRunnableInMsec ;
73
77
}
74
78
75
79
private ParquetReaderConfig () { }
@@ -99,6 +103,9 @@ public boolean enableStringsSignedMinMax() {
99
103
return enableStringsSignedMinMax ;
100
104
}
101
105
106
+ @ JsonProperty ("timeoutPerRunnableInMsec" )
107
+ public long timeoutPerRunnableInMsec () { return timeoutPerRunnableInMsec ; }
108
+
102
109
public ParquetReadOptions toReadOptions () {
103
110
return ParquetReadOptions .builder ()
104
111
.useSignedStringMinMax (enableStringsSignedMinMax )
@@ -119,7 +126,8 @@ public int hashCode() {
119
126
enableBytesTotalCounter ,
120
127
enableTimeReadCounter ,
121
128
autoCorrectCorruptedDates ,
122
- enableStringsSignedMinMax );
129
+ enableStringsSignedMinMax ,
130
+ timeoutPerRunnableInMsec );
123
131
}
124
132
125
133
@ Override
@@ -135,7 +143,8 @@ public boolean equals(Object o) {
135
143
&& enableBytesTotalCounter == that .enableBytesTotalCounter
136
144
&& enableTimeReadCounter == that .enableTimeReadCounter
137
145
&& autoCorrectCorruptedDates == that .autoCorrectCorruptedDates
138
- && enableStringsSignedMinMax == that .enableStringsSignedMinMax ;
146
+ && enableStringsSignedMinMax == that .enableStringsSignedMinMax
147
+ && timeoutPerRunnableInMsec == that .timeoutPerRunnableInMsec ;
139
148
}
140
149
141
150
@ Override
@@ -146,6 +155,7 @@ public String toString() {
146
155
+ ", enableTimeReadCounter=" + enableTimeReadCounter
147
156
+ ", autoCorrectCorruptedDates=" + autoCorrectCorruptedDates
148
157
+ ", enableStringsSignedMinMax=" + enableStringsSignedMinMax
158
+ + ", timeoutPerRunnableInMsec=" + timeoutPerRunnableInMsec
149
159
+ '}' ;
150
160
}
151
161
@@ -188,10 +198,12 @@ public ParquetReaderConfig build() {
188
198
189
199
// last assign values from session options, session options have higher priority than other configurations
190
200
if (options != null ) {
191
- String option = options .getOption (ExecConstants .PARQUET_READER_STRINGS_SIGNED_MIN_MAX_VALIDATOR );
192
- if (!option .isEmpty ()) {
193
- readerConfig .enableStringsSignedMinMax = Boolean .valueOf (option );
201
+ String optionSignedMinMax = options .getOption (ExecConstants .PARQUET_READER_STRINGS_SIGNED_MIN_MAX_VALIDATOR );
202
+ if (!optionSignedMinMax .isEmpty ()) {
203
+ readerConfig .enableStringsSignedMinMax = Boolean .valueOf (optionSignedMinMax );
194
204
}
205
+ Long optionTimeout = options .getOption (ExecConstants .PARQUET_REFRESH_TIMEOUT_VALIDATOR );
206
+ readerConfig .timeoutPerRunnableInMsec = Long .valueOf (optionTimeout );
195
207
}
196
208
197
209
return readerConfig ;
0 commit comments