public static ExpressionComparer[] ParseOrderBy(Graph graph, VariableMap variableMap, IOrderByExecutionHelper executionHelper, OrderByNode orderByNode, QueryExpressionInfo exprInfo, int columnCount)
        {
            if (executionHelper == null || orderByNode == null || variableMap == null || graph == null || exprInfo == null)
            {
                throw new ArgumentNullException($"Order by result processor, passing null arguments to the constructor.");
            }

            var orderByVisitor = new OrderByVisitor(graph.labels, variableMap, exprInfo);

            orderByVisitor.Visit(orderByNode);
            var comps = orderByVisitor.GetResult();

            executionHelper.IsSetOrderBy = true;

            return(comps.ToArray());
        }
Example #2
0
        /// <summary>
        /// Creates an order by object.
        /// </summary>
        /// <param name="graph"> A graph the query is computed on. </param>
        /// <param name="variableMap"> A map of query variables. </param>
        /// <param name="executionHelper"> An order by execution helper. </param>
        /// <param name="orderByNode"> A parse tree of order by expression. </param>
        /// <param name="exprInfo"> A query expression information. </param>
        public OrderByObject(Graph graph, VariableMap variableMap, IOrderByExecutionHelper executionHelper, OrderByNode orderByNode, QueryExpressionInfo exprInfo)
        {
            if (executionHelper == null || orderByNode == null || variableMap == null || graph == null || exprInfo == null)
            {
                throw new ArgumentNullException($"{this.GetType()}, passing null arguments to the constructor.");
            }

            this.helper = executionHelper;

            var orderByVisitor = new OrderByVisitor(graph.labels, variableMap, exprInfo);

            orderByVisitor.Visit(orderByNode);
            var comps = orderByVisitor.GetResult();

            executionHelper.IsSetOrderBy = true;
            this.comparers = comps.ToArray();
        }