ayushtkn commented on code in PR #6581:
URL: https://github.com/apache/hive/pull/6581#discussion_r3618779846
##########
ql/src/java/org/apache/hadoop/hive/ql/udf/esri/ST_MaxZ.java:
##########
@@ -63,17 +64,26 @@ public DoubleWritable evaluate(BytesWritable geomref) {
return null;
}
- OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref);
- if (ogcGeometry == null) {
+ Geometry geom = GeometryUtils.geometryFromEsriShape(geomref);
+ if (geom == null) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
- if (!ogcGeometry.is3D()) {
Review Comment:
Yes. JTS has no per-Geometry `is3D()`, but `CoordinateSequence` exposes
`hasZ()`/`hasM()`, which `GeometryUtils.getOrdinates()` already inspects. I
added `GeometryUtils.is3D(geom)` / `isMeasured(geom)` on top of it and used
them as an early-out in `ST_MaxZ`, `ST_MinZ`, `ST_MaxM`, `ST_MinM`, so a purely
2D geometry returns after one sequence check instead of walking every
coordinate.
##########
ql/src/java/org/apache/hadoop/hive/ql/udf/esri/ST_MinM.java:
##########
@@ -63,17 +64,26 @@ public DoubleWritable evaluate(BytesWritable geomref) {
return null;
}
- OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref);
- if (ogcGeometry == null) {
+ Geometry geom = GeometryUtils.geometryFromEsriShape(geomref);
+ if (geom == null) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
- if (!ogcGeometry.isMeasured()) {
Review Comment:
answered above
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]