diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/result/Utils.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/result/Utils.java index 9efa9876747b..18bcaed313a3 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/result/Utils.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/result/Utils.java @@ -132,8 +132,10 @@ public static RelDataType getEdgeType(RelDataType graphPathType) { return graphPathType; } - public static String parseLabelValue(Common.Value value, GraphLabelType type) { + public static Object parseLabelValue(Common.Value value, GraphLabelType type) { switch (value.getItemCase()) { + case NONE: + return null; case STR: return value.getStr(); case I32: diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/cypher/result/CypherRecordParser.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/cypher/result/CypherRecordParser.java index 6127445100b8..8c829a2b3480 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/cypher/result/CypherRecordParser.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/cypher/result/CypherRecordParser.java @@ -304,7 +304,14 @@ protected AnyValue parseGraphPath(IrResult.GraphPath path, @Nullable RelDataType protected AnyValue parseValue(Common.Value value, @Nullable RelDataType dataType) { if (dataType instanceof GraphLabelType) { - return Values.stringValue(Utils.parseLabelValue(value, (GraphLabelType) dataType)); + Object labelValue = Utils.parseLabelValue(value, (GraphLabelType) dataType); + if (labelValue == null) { + return Values.NO_VALUE; + } else if (labelValue instanceof String) { + return Values.stringValue((String) labelValue); + } else { + return Values.stringValue(labelValue.toString()); + } } switch (value.getItemCase()) { case BOOLEAN: