-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for nested types, geoparquet groups, and postgres jsonb in data table #860
Conversation
baremaps-geoparquet/src/main/java/org/apache/baremaps/geoparquet/data/GeoParquetGroup.java
Fixed
Show fixed
Hide fixed
baremaps-geoparquet/src/main/java/org/apache/baremaps/geoparquet/data/GeoParquetGroup.java
Fixed
Show fixed
Hide fixed
baremaps-geoparquet/src/main/java/org/apache/baremaps/geoparquet/data/GeoParquetGroup.java
Fixed
Show fixed
Hide fixed
baremaps-geoparquet/src/main/java/org/apache/baremaps/geoparquet/data/GeoParquetGroup.java
Fixed
Show fixed
Hide fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good, I just added two comments.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an optional field or a group is null in the geoparquet file, this will raise an exception. The same thing happens in the asRowValues
method. I tested it with real Overture data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bchapuis My instinct would say that when a field is optional we use Optional. This way we can make a difference (in the way our code explains it) with fields which are not optional with a null value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebr72 The problem is that we also need to return Optional for each values in a potentially very big geoparquet file. As for the List, I'm a bit worried about the overhead. It also means that we need to return Optional for required values.
Here are some interesting arguments for and against the use of Optional:
https://blogs.oracle.com/javamagazine/post/optional-class-null-pointer-drawbacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bchapuis based on the article and your concern about the overhead, I am happy if we don't use Optional.
baremaps-geoparquet/src/main/java/org/apache/baremaps/geoparquet/data/GeoParquetGroupImpl.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Antoine Drabble <antoine.drabble@gmail.com>
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
No description provided.