bchapuis commented on code in PR #860:
URL:
https://github.com/apache/incubator-baremaps/pull/860#discussion_r1623367027
##########
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:
This is a good point. I'm not a fan of returning Optional everywhere, but
this is something we could consider. Another option could be to return null and
let the user check for it.
@Drabble @sebr72 Which variant do you prefer?
--
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]