diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/IrMeta.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/IrMeta.java index 6035e96490cb..e8b5c331b5ed 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/IrMeta.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/IrMeta.java @@ -21,8 +21,6 @@ import com.alibaba.graphscope.common.ir.meta.procedure.GraphStoredProcedures; import com.alibaba.graphscope.common.ir.meta.schema.IrGraphSchema; -import org.checkerframework.checker.nullness.qual.Nullable; - import java.util.Objects; /** @@ -33,10 +31,10 @@ public class IrMeta { protected final GraphId graphId; protected final SnapshotId snapshotId; protected final IrGraphSchema schema; - protected final @Nullable GraphStoredProcedures storedProcedures; + protected final GraphStoredProcedures storedProcedures; public IrMeta(IrGraphSchema schema) { - this(SnapshotId.createEmpty(), schema); + this(GraphId.DEFAULT, SnapshotId.createEmpty(), schema, new GraphStoredProcedures()); } public IrMeta(IrGraphSchema schema, GraphStoredProcedures storedProcedures) { @@ -44,7 +42,7 @@ public IrMeta(IrGraphSchema schema, GraphStoredProcedures storedProcedures) { } public IrMeta(SnapshotId snapshotId, IrGraphSchema schema) { - this(GraphId.DEFAULT, snapshotId, schema, null); + this(GraphId.DEFAULT, snapshotId, schema, new GraphStoredProcedures()); } public IrMeta( @@ -55,7 +53,7 @@ public IrMeta( this.graphId = graphId; this.snapshotId = Objects.requireNonNull(snapshotId); this.schema = Objects.requireNonNull(schema); - this.storedProcedures = storedProcedures; + this.storedProcedures = Objects.requireNonNull(storedProcedures); } public IrGraphSchema getSchema() { @@ -66,7 +64,7 @@ public SnapshotId getSnapshotId() { return snapshotId; } - public @Nullable GraphStoredProcedures getStoredProcedures() { + public GraphStoredProcedures getStoredProcedures() { return storedProcedures; } diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/procedure/StoredProcedureMeta.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/procedure/StoredProcedureMeta.java index 2e58b20a7daa..c0e00ddde078 100644 --- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/procedure/StoredProcedureMeta.java +++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/procedure/StoredProcedureMeta.java @@ -238,45 +238,47 @@ private static T getValue( Object value = valueMap.get(config.getKey()); return (value != null) ? (T) value : config.get(new Configs(ImmutableMap.of())); } - } - public static RelDataType createReturnType( - List config, GSDataTypeConvertor typeConvertor) { - List fields = Lists.newArrayList(); - if (config == null) { + private static RelDataType createReturnType( + List config, GSDataTypeConvertor typeConvertor) { + List fields = Lists.newArrayList(); + if (config == null) { + return new RelRecordType(fields); + } + Iterator iterator = config.iterator(); + int index = 0; + while (iterator.hasNext()) { + Map field = (Map) iterator.next(); + fields.add( + new RelDataTypeFieldImpl( + (String) field.get("name"), + index, + typeConvertor.convert( + new GSDataTypeDesc( + (Map) field.get("type"))))); + ++index; + } return new RelRecordType(fields); } - Iterator iterator = config.iterator(); - int index = 0; - while (iterator.hasNext()) { - Map field = (Map) iterator.next(); - fields.add( - new RelDataTypeFieldImpl( - (String) field.get("name"), - index, - typeConvertor.convert( - new GSDataTypeDesc((Map) field.get("type"))))); - ++index; - } - return new RelRecordType(fields); - } - public static List createParameters( - List config, GSDataTypeConvertor typeConvertor) { - List parameters = Lists.newArrayList(); - if (config == null) { + private static List createParameters( + List config, GSDataTypeConvertor typeConvertor) { + List parameters = Lists.newArrayList(); + if (config == null) { + return parameters; + } + Iterator iterator = config.iterator(); + while (iterator.hasNext()) { + Map field = (Map) iterator.next(); + parameters.add( + new StoredProcedureMeta.Parameter( + (String) field.get("name"), + typeConvertor.convert( + new GSDataTypeDesc( + (Map) field.get("type"))))); + } return parameters; } - Iterator iterator = config.iterator(); - while (iterator.hasNext()) { - Map field = (Map) iterator.next(); - parameters.add( - new StoredProcedureMeta.Parameter( - (String) field.get("name"), - typeConvertor.convert( - new GSDataTypeDesc((Map) field.get("type"))))); - } - return parameters; } public enum Mode implements GraphPlanExecutor { diff --git a/interactive_engine/compiler/src/main/java/org/apache/calcite/sql/type/GraphOperandTypes.java b/interactive_engine/compiler/src/main/java/org/apache/calcite/sql/type/GraphOperandTypes.java index 2522b5e00991..b75b862c8530 100644 --- a/interactive_engine/compiler/src/main/java/org/apache/calcite/sql/type/GraphOperandTypes.java +++ b/interactive_engine/compiler/src/main/java/org/apache/calcite/sql/type/GraphOperandTypes.java @@ -81,10 +81,6 @@ public abstract class GraphOperandTypes { * @param families * @return */ - // public static FamilyOperandTypeChecker family(SqlTypeFamily... families) { - // return new GraphFamilyOperandTypeChecker(ImmutableList.copyOf(families), i -> false); - // } - public static FamilyOperandTypeChecker family(RelDataTypeFamily... families) { return new GraphFamilyOperandTypeChecker(ImmutableList.copyOf(families), i -> false); }