@@ -106,6 +106,25 @@ static inline BoundaryOrder::type FromThriftUnsafe(format::BoundaryOrder::type t
106
106
return static_cast <BoundaryOrder::type>(type);
107
107
}
108
108
109
+ static inline GeometryLogicalType::EdgeInterpolationAlgorithm FromThriftUnsafe (
110
+ format::EdgeInterpolationAlgorithm::type type) {
111
+ switch (type) {
112
+ case format::EdgeInterpolationAlgorithm::SPHERICAL:
113
+ return GeometryLogicalType::EdgeInterpolationAlgorithm::SPHERICAL;
114
+ case format::EdgeInterpolationAlgorithm::VINCENTY:
115
+ return GeometryLogicalType::EdgeInterpolationAlgorithm::VINCENTY;
116
+ case format::EdgeInterpolationAlgorithm::THOMAS:
117
+ return GeometryLogicalType::EdgeInterpolationAlgorithm::THOMAS;
118
+ case format::EdgeInterpolationAlgorithm::ANDOYER:
119
+ return GeometryLogicalType::EdgeInterpolationAlgorithm::ANDOYER;
120
+ case format::EdgeInterpolationAlgorithm::KARNEY:
121
+ return GeometryLogicalType::EdgeInterpolationAlgorithm::KARNEY;
122
+ default :
123
+ ARROW_DCHECK (false ) << " Cannot reach here" ;
124
+ return GeometryLogicalType::EdgeInterpolationAlgorithm::UNKNOWN;
125
+ }
126
+ }
127
+
109
128
namespace internal {
110
129
111
130
template <typename T>
@@ -221,6 +240,15 @@ inline typename Compression::type LoadEnumSafe(const format::CompressionCodec::t
221
240
return FromThriftUnsafe (*in);
222
241
}
223
242
243
+ inline typename LogicalType::EdgeInterpolationAlgorithm LoadEnumSafe (
244
+ const format::EdgeInterpolationAlgorithm::type* in) {
245
+ if (ARROW_PREDICT_FALSE (*in < format::EdgeInterpolationAlgorithm::SPHERICAL ||
246
+ *in > format::EdgeInterpolationAlgorithm::KARNEY)) {
247
+ return LogicalType::EdgeInterpolationAlgorithm::UNKNOWN;
248
+ }
249
+ return FromThriftUnsafe (*in);
250
+ }
251
+
224
252
// Safe non-enum converters
225
253
226
254
static inline AadMetadata FromThrift (format::AesGcmV1 aesGcmV1) {
@@ -281,25 +309,6 @@ static inline format::EdgeInterpolationAlgorithm::type ToThrift(
281
309
}
282
310
}
283
311
284
- static inline LogicalType::EdgeInterpolationAlgorithm FromThrift (
285
- const format::EdgeInterpolationAlgorithm::type algorithm) {
286
- switch (algorithm) {
287
- case format::EdgeInterpolationAlgorithm::SPHERICAL:
288
- return LogicalType::EdgeInterpolationAlgorithm::SPHERICAL;
289
- case format::EdgeInterpolationAlgorithm::VINCENTY:
290
- return LogicalType::EdgeInterpolationAlgorithm::VINCENTY;
291
- case format::EdgeInterpolationAlgorithm::THOMAS:
292
- return LogicalType::EdgeInterpolationAlgorithm::THOMAS;
293
- case format::EdgeInterpolationAlgorithm::ANDOYER:
294
- return LogicalType::EdgeInterpolationAlgorithm::ANDOYER;
295
- case format::EdgeInterpolationAlgorithm::KARNEY:
296
- return LogicalType::EdgeInterpolationAlgorithm::KARNEY;
297
- default :
298
- throw ParquetException (" Unknown value for geometry algorithm: " ,
299
- static_cast <int >(algorithm));
300
- }
301
- }
302
-
303
312
static inline EncryptionAlgorithm FromThrift (format::EncryptionAlgorithm encryption) {
304
313
EncryptionAlgorithm encryption_algorithm;
305
314
0 commit comments