Example #1
0
        internal virtual void DedupGlobal(GremlinToSqlContext currentContext, List <string> dedupLabels, GraphTraversal2 dedupTraversal)
        {
            List <GremlinVariable> dedupVariables = new List <GremlinVariable>();

            foreach (var dedupLabel in dedupLabels)
            {
                dedupVariables.Add(GetSelectVar(currentContext, GremlinKeyword.Pop.Last, new List <string> {
                    dedupLabel
                }, new List <GraphTraversal2>()
                {
                    dedupTraversal.Copy()
                }));
            }

            dedupTraversal.GetStartOp().InheritedVariableFromParent(currentContext);
            GremlinToSqlContext dedupContext = dedupTraversal.GetEndOp().GetContext();

            GremlinDedupGlobalVariable newVariable = new GremlinDedupGlobalVariable(this, dedupVariables, dedupContext);

            currentContext.VariableList.Add(newVariable);
            currentContext.TableReferences.Add(newVariable);
        }