Skip to content
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

Fix geoarrow sonar #934

Merged
merged 6 commits into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,18 @@ protected Converter makeConverter(Context child) {
return new StructConverter(child) {

@Override
public void start() {}
public void start() {
// don't start a new struct
}

@Override
protected Converter makeConverter(Context child) {
return new StructConverter(child) {

@Override
public void start() {}
public void start() {
// don't start a new struct
}

@Override
public void end() {
Expand Down Expand Up @@ -235,12 +239,6 @@ public void addDouble(double value) {

@Override
protected Converter makeConverter(Context child) {
class CoordinateSetter extends PrimitiveConverter {
@Override
public void addDouble(double value) {
super.addDouble(value);
}
}
return switch (child.type.getName()) {
case "x" -> ordinateSetter(0);
case "y" -> ordinateSetter(1);
Expand Down Expand Up @@ -593,12 +591,12 @@ public boolean isGeoArrowCoordSeq() {
repeatedElement.asGroupType().getFieldCount() != 1) {
return false;
}
return isGeoarrowCoordinate(repeatedElement.asGroupType().getType(0));
return isGeoArrowCoordinate(repeatedElement.asGroupType().getType(0));
}

public boolean isGeoArrowCoordinate() {
String geoArrowType = getGeoArrowType();
return geoArrowType != null && geoArrowType.contains("point") && isGeoarrowCoordinate(type);
return geoArrowType != null && geoArrowType.contains("point") && isGeoArrowCoordinate(type);
}

private String getGeoArrowType() {
Expand All @@ -612,7 +610,7 @@ private String getGeoArrowType() {
}
}

private static boolean isGeoarrowCoordinate(Type struct) {
private static boolean isGeoArrowCoordinate(Type struct) {
if (struct.isPrimitive()) {
return false;
}
Expand Down
Loading