Skip to content

Commit

Permalink
Forward specified property schema to Neo4j arrow server
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthMax authored and soerenreichardt committed Dec 20, 2023
1 parent 93d58fe commit 64b7e39
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@

import org.jetbrains.annotations.Nullable;
import org.neo4j.gds.api.DefaultValue;
import org.neo4j.gds.utils.StringJoining;

import java.util.Arrays;

import static org.neo4j.gds.utils.StringFormatting.formatWithLocale;

public enum ValueType {
LONG {
Expand Down Expand Up @@ -188,17 +193,31 @@ public static ValueType fromCsvName(String csvName) {
return value;
}
}
throw new IllegalArgumentException("Unexpected value: " + csvName);

throw new IllegalArgumentException(
formatWithLocale(
"Unknown value: %s, supported values are: %s",
csvName,
StringJoining.join(Arrays.stream(ValueType.values()).map(ValueType::csvName))
)
);
}

public interface Visitor<RESULT> {
RESULT visitLong();

RESULT visitDouble();

RESULT visitString();

RESULT visitLongArray();

RESULT visitDoubleArray();

RESULT visitFloatArray();

default @Nullable RESULT visitUnknown() { return null; }
default @Nullable RESULT visitUnknown() {
return null;
}
}
}

0 comments on commit 64b7e39

Please sign in to comment.