Fix geoarrow sonar (#934)

pull/935/head
Michael Barry 2024-06-27 08:54:30 -04:00 zatwierdzone przez GitHub
rodzic cf534c1ff4
commit 73a8144cfe
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 9 dodań i 11 usunięć

Wyświetl plik

@ -168,14 +168,18 @@ public class ParquetRecordConverter extends RecordMaterializer<Map<String, Objec
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() {
@ -235,12 +239,6 @@ public class ParquetRecordConverter extends RecordMaterializer<Map<String, Objec
@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);
@ -593,12 +591,12 @@ public class ParquetRecordConverter extends RecordMaterializer<Map<String, Objec
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() {
@ -612,7 +610,7 @@ public class ParquetRecordConverter extends RecordMaterializer<Map<String, Objec
}
}
private static boolean isGeoarrowCoordinate(Type struct) {
private static boolean isGeoArrowCoordinate(Type struct) {
if (struct.isPrimitive()) {
return false;
}