sebr72 commented on code in PR #860:
URL:
https://github.com/apache/incubator-baremaps/pull/860#discussion_r1624261828
##########
baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetTypeConversion.java:
##########
@@ -69,9 +80,33 @@ public static List<Object> asRowValues(GeoParquetGroup
group) {
case DOUBLE -> values.add(group.getDoubleValue(i));
case STRING -> values.add(group.getStringValue(i));
case GEOMETRY -> values.add(group.getGeometryValue(i));
- case GROUP -> values.add(null); // TODO:
values.add(asDataRow(group.getGroupValue(i)));
+ case ENVELOPE -> values.add(group.getEnvelopeValue(i));
+ case GROUP -> values.add(asNested(group.getGroupValue(i)));
}
}
return values;
}
+
+ public static Map<String, Object> asNested(GeoParquetGroup group) {
+ Map<String, Object> nested = new HashMap<>();
+ Schema schema = group.getSchema();
+ List<Field> fields = schema.fields();
+ for (int i = 0; i < fields.size(); i++) {
+ Field field = fields.get(i);
+ nested.put(field.name(), switch (field.type()) {
+ case BINARY -> group.getBinaryValue(i).getBytes();
Review Comment:
@bchapuis My instinct would say that when a field is optional we use
Optional. This way we can make a difference with fields which are not optional
with a null value (in the way our code explains it).
--
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]