public static GremlinUnionVariable Create(List <GremlinToSqlContext> unionContextList) { if (unionContextList.Count == 0) { return(new GremlinUnionNullVariable(unionContextList)); } if (GremlinUtil.IsTheSameOutputType(unionContextList)) { switch (unionContextList.First().PivotVariable.GetVariableType()) { case GremlinVariableType.Vertex: return(new GremlinUnionVertexVariable(unionContextList)); case GremlinVariableType.Edge: return(new GremlinUnionEdgeVariable(unionContextList)); case GremlinVariableType.Scalar: return(new GremlinUnionScalarVariable(unionContextList)); case GremlinVariableType.NULL: return(new GremlinUnionNullVariable(unionContextList)); case GremlinVariableType.Property: return(new GremlinUnionPropertyVariable(unionContextList)); } } return(new GremlinUnionTableVariable(unionContextList)); }
public static GremlinCoalesceVariable Create(List <GremlinToSqlContext> coalesceContextList) { if (GremlinUtil.IsTheSameOutputType(coalesceContextList)) { switch (coalesceContextList.First().PivotVariable.GetVariableType()) { case GremlinVariableType.Vertex: return(new GremlinCoalesceVertexVariable(coalesceContextList)); case GremlinVariableType.Edge: return(new GremlinCoalesceEdgeVariable(coalesceContextList)); case GremlinVariableType.Scalar: return(new GremlinCoalesceScalarVariable(coalesceContextList)); case GremlinVariableType.Property: return(new GremlinCoalescePropertyVariable(coalesceContextList)); } } return(new GremlinCoalesceTableVariable(coalesceContextList)); }