dongjoon-hyun commented on code in PR #2032:
URL: https://github.com/apache/orc/pull/2032#discussion_r2132970853
##########
java/core/src/java/org/apache/orc/OrcUtils.java:
##########
@@ -325,6 +354,43 @@ TypeDescription
convertTypeFromProtobuf(List<OrcProto.Type> types,
result.withPrecision(type.getPrecision());
}
break;
+ case GEOMETRY:
+ result = TypeDescription.createGeometry();
+ if (type.hasCrs()) {
+ result.withCRS(type.getCrs());
+ }
+ break;
+ case GEOGRAPHY:
+ result = TypeDescription.createGeography();
+ if (type.hasCrs()) {
+ result.withCRS(type.getCrs());
+ }
+ switch (type.getAlgorithm()) {
+ case SPHERICAL:
+ result.withEdgeInterpolationAlgorithm(
+ TypeDescription.EdgeInterpolationAlgorithm.SPHERICAL);
+ break;
+ case VINCENTY:
+ result.withEdgeInterpolationAlgorithm(
+ TypeDescription.EdgeInterpolationAlgorithm.VINCENTY);
+ break;
+ case THOMAS:
+ result.withEdgeInterpolationAlgorithm(
+ TypeDescription.EdgeInterpolationAlgorithm.THOMAS);
+ break;
+ case ANDOYER:
+ result.withEdgeInterpolationAlgorithm(
+ TypeDescription.EdgeInterpolationAlgorithm.ANDOYER);
+ break;
+ case KARNEY:
+ result.withEdgeInterpolationAlgorithm(
+ TypeDescription.EdgeInterpolationAlgorithm.KARNEY);
Review Comment:
Let's import `EdgeInterpolationAlgorithm`
```java
+import org.apache.orc.TypeDescription.EdgeInterpolationAlgorithm;
import org.apache.orc.impl.ParserUtils;
import org.apache.orc.impl.ReaderImpl;
import org.apache.orc.impl.SchemaEvolution;
```
Then, we can simplify these.
```java
case SPHERICAL:
- result.withEdgeInterpolationAlgorithm(
- TypeDescription.EdgeInterpolationAlgorithm.SPHERICAL);
+
result.withEdgeInterpolationAlgorithm(EdgeInterpolationAlgorithm.SPHERICAL);
break;
case VINCENTY:
- result.withEdgeInterpolationAlgorithm(
- TypeDescription.EdgeInterpolationAlgorithm.VINCENTY);
+
result.withEdgeInterpolationAlgorithm(EdgeInterpolationAlgorithm.VINCENTY);
break;
case THOMAS:
- result.withEdgeInterpolationAlgorithm(
- TypeDescription.EdgeInterpolationAlgorithm.THOMAS);
+
result.withEdgeInterpolationAlgorithm(EdgeInterpolationAlgorithm.THOMAS);
break;
case ANDOYER:
- result.withEdgeInterpolationAlgorithm(
- TypeDescription.EdgeInterpolationAlgorithm.ANDOYER);
+
result.withEdgeInterpolationAlgorithm(EdgeInterpolationAlgorithm.ANDOYER);
break;
case KARNEY:
- result.withEdgeInterpolationAlgorithm(
- TypeDescription.EdgeInterpolationAlgorithm.KARNEY);
+
result.withEdgeInterpolationAlgorithm(EdgeInterpolationAlgorithm.KARNEY);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]