• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IQueryPlanNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IQueryPlanNode的典型用法代码示例。如果您正苦于以下问题:C# IQueryPlanNode类的具体用法?C# IQueryPlanNode怎么用?C# IQueryPlanNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IQueryPlanNode类属于命名空间,在下文中一共展示了IQueryPlanNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SimpleSelectNode

 public SimpleSelectNode(IQueryPlanNode child, ObjectName columnName, SqlExpressionType op, SqlExpression expression)
     : base(child)
 {
     ColumnName = columnName;
     OperatorType = op;
     Expression = expression;
 }
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:SimpleSelectNode.cs


示例2: JoinNode

 public JoinNode(IQueryPlanNode left, IQueryPlanNode right, ObjectName leftColumnName, SqlExpressionType @operator, SqlExpression rightExpression)
     : base(left, right)
 {
     LeftColumnName = leftColumnName;
     Operator = @operator;
     RightExpression = rightExpression;
 }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:7,代码来源:JoinNode.cs


示例3: SimpleSelectNode

 public SimpleSelectNode(IQueryPlanNode child, ObjectName leftVar, Operator op, Expression rightExpression)
     : base(child)
 {
     this.leftVar = leftVar;
     this.op = op;
     this.rightExpression = rightExpression;
 }
开发者ID:kaktusan,项目名称:plsqlparser,代码行数:7,代码来源:SimpleSelectNode.cs


示例4: SortNode

        public SortNode(IQueryPlanNode child, ObjectName[] columnNames, bool[] ascending)
            : base(child)
        {
            // How we handle ascending/descending order
            // ----------------------------------------
            // Internally to the database, all columns are naturally ordered in
            // ascending order (start at lowest and end on highest).  When a column
            // is ordered in descending order, a fast way to achieve this is to take
            // the ascending set and reverse it.  This works for single columns,
            // however some thought is required for handling multiple column.  We
            // order columns from RHS to LHS.  If LHS is descending then this will
            // order the RHS incorrectly if we leave as is.  Therefore, we must do
            // some pre-processing that looks ahead on any descending orders and
            // reverses the order of the columns to the right.  This pre-processing
            // is done in the first pass.

            int sz = ascending.Length;
            for (int n = 0; n < sz - 1; ++n) {
                if (!ascending[n]) {    // if descending...
                    // Reverse order of all columns to the right...
                    for (int p = n + 1; p < sz; ++p) {
                        ascending[p] = !ascending[p];
                    }
                }
            }

            ColumnNames = columnNames;
            Ascending = ascending;
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:29,代码来源:SortNode.cs


示例5: NonCorrelatedAnyAllNode

 public NonCorrelatedAnyAllNode(IQueryPlanNode left, IQueryPlanNode right, ObjectName[] leftColumnNames, SqlExpressionType subQueryType, bool isAll)
     : base(left, right)
 {
     LeftColumnNames = leftColumnNames;
     SubQueryType = subQueryType;
     IsAll = isAll;
 }
开发者ID:deveel,项目名称:deveeldb,代码行数:7,代码来源:NonCorrelatedAnyAllNode.cs


示例6: JoinNode

 public JoinNode(IQueryPlanNode left, IQueryPlanNode right, ObjectName leftVar, Operator joinOp, Expression rightExpression)
     : base(left, right)
 {
     this.leftVar = leftVar;
     this.joinOp = joinOp;
     this.rightExpression = rightExpression;
 }
开发者ID:kaktusan,项目名称:plsqlparser,代码行数:7,代码来源:JoinNode.cs


示例7: CachePointNode

 public CachePointNode(IQueryPlanNode child)
     : base(child)
 {
     lock (GlobLock) {
         id = ((int) DateTime.Now.Ticks << 16) | (GlobId & 0x0FFFF);
         ++GlobId;
     }
 }
开发者ID:kaktusan,项目名称:plsqlparser,代码行数:8,代码来源:CachePointNode.cs


示例8: GroupNode

 /// <summary>
 /// Groups over the given columns from the child.
 /// </summary>
 /// <param name="child"></param>
 /// <param name="columns"></param>
 /// <param name="groupMaxColumn"></param>
 /// <param name="functionList"></param>
 /// <param name="nameList"></param>
 public GroupNode(IQueryPlanNode child, ObjectName[] columns, ObjectName groupMaxColumn, Expression[] functionList, string[] nameList)
     : base(child)
 {
     this.columns = columns;
     this.groupMaxColumn = groupMaxColumn;
     this.functionList = functionList;
     this.nameList = nameList;
 }
开发者ID:kaktusan,项目名称:plsqlparser,代码行数:16,代码来源:GroupNode.cs


示例9: GroupNode

 public GroupNode(IQueryPlanNode child, ObjectName[] columnNames, ObjectName groupMaxColumn, SqlExpression[] functions, string[] names)
     : base(child)
 {
     ColumnNames = columnNames;
     GroupMaxColumn = groupMaxColumn;
     Functions = functions;
     Names = names;
 }
开发者ID:prepare,项目名称:deveeldb,代码行数:8,代码来源:GroupNode.cs


示例10: PlanTableSource

 // How this plan is naturally joined to other plans in the source.  A
 // plan either has no dependance, a left or a right dependance, or a left
 // and right dependance.
 public PlanTableSource(IQueryPlanNode plan, ObjectName[] variables, string[] uniqueNames)
 {
     Plan = plan;
     VariableNames = variables;
     UniqueNames = uniqueNames;
     LeftJoinType = JoinType.None;
     RightJoinType = JoinType.None;
     IsUpdated = false;
 }
开发者ID:kaktusan,项目名称:plsqlparser,代码行数:12,代码来源:PlanTableSource.cs


示例11: DefineView

        public static void DefineView(this IQuery context, ObjectName viewName, IQueryPlanNode queryPlan, bool replaceIfExists)
        {
            // We have to execute the plan to get the TableInfo that represents the
            // result of the view execution.
            var table = queryPlan.Evaluate(context);
            var tableInfo = table.TableInfo.Alias(viewName);

            var viewInfo = new ViewInfo(tableInfo, null, queryPlan);
            context.DefineView(viewInfo, replaceIfExists);
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:10,代码来源:QueryExtensions.cs


示例12: ViewInfo

        public ViewInfo(TableInfo tableInfo, SqlQueryExpression queryExpression, IQueryPlanNode queryPlan)
        {
            if (tableInfo == null)
                throw new ArgumentNullException("tableInfo");
            if (queryExpression == null)
                throw new ArgumentNullException("queryExpression");

            TableInfo = tableInfo;
            QueryExpression = queryExpression;
            QueryPlan = queryPlan;
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:11,代码来源:ViewInfo.cs


示例13: SerializeQueryPlan

        public static void SerializeQueryPlan(this ISystemContext context, IQueryPlanNode node, BinaryWriter writer)
        {
            var nodeType = node.GetType();

            var serializers = context.ResolveAllServices<IQueryPlanNodeSerializer>();
            foreach (var serializer in serializers) {
                if (serializer.CanSerialize(nodeType)) {
                    serializer.Serialize(node, writer);
                    return;
                }
            }

            throw new InvalidOperationException(string.Format("Could not find any serializer for node type '{0}'.", nodeType));
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:14,代码来源:SystemContextExtensions.cs


示例14: TablePlan

        public TablePlan(IQueryPlanNode plan, ObjectName[] columnNames, string[] uniqueNames)
        {
            if (plan == null)
                throw new ArgumentNullException("plan");
            if (columnNames == null)
                throw new ArgumentNullException("columnNames");

            Plan = plan;
            ColumnNames = columnNames;
            UniqueNames = uniqueNames;
            LeftJoinType = JoinType.None;
            RightJoinType = JoinType.None;
            IsUpdated = false;
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:14,代码来源:TablePlan.cs


示例15: UpdateTable

        public static int UpdateTable(this IQuery context, ObjectName tableName, IQueryPlanNode queryPlan,
			IEnumerable<SqlAssignExpression> assignments, int limit)
        {
            var columnNames = assignments.Select(x => x.ReferenceExpression)
                .Cast<SqlReferenceExpression>()
                .Select(x => x.ReferenceName.Name).ToArray();

            if (!context.UserCanUpdateTable(tableName, columnNames))
                throw new MissingPrivilegesException(context.UserName(), tableName, Privileges.Update);

            if (!context.UserCanSelectFromPlan(queryPlan))
                throw new InvalidOperationException();

            var table = context.GetMutableTable(tableName);
            if (table == null)
                throw new ObjectNotFoundException(tableName);

            var updateSet = queryPlan.Evaluate(context);
            return table.Update(context, updateSet, assignments, limit);
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:20,代码来源:QueryExtensions.Commands.cs


示例16: SimplePatternSelectNode

 public SimplePatternSelectNode(IQueryPlanNode child, SqlExpression expression)
     : base(child)
 {
     Expression = expression;
 }
开发者ID:furesoft,项目名称:deveeldb,代码行数:5,代码来源:SimplePatternSelectNode.cs


示例17: ExhaustiveSelectNode

 public ExhaustiveSelectNode(IQueryPlanNode child, SqlExpression exp)
     : base(child)
 {
     Expression = exp;
 }
开发者ID:prepare,项目名称:deveeldb,代码行数:5,代码来源:ExhaustiveSelectNode.cs


示例18: SingleQueryPlanNode

 protected SingleQueryPlanNode(IQueryPlanNode child)
 {
     Child = child;
 }
开发者ID:furesoft,项目名称:deveeldb,代码行数:4,代码来源:SingleQueryPlanNode.cs


示例19: CompositeNode

 public CompositeNode(IQueryPlanNode left, IQueryPlanNode right, CompositeFunction compositeOp, bool allOp)
     : base(left, right)
 {
     CompositeFunction = compositeOp;
     All = allOp;
 }
开发者ID:deveel,项目名称:deveeldb,代码行数:6,代码来源:CompositeNode.cs


示例20: PlanForOrderBy

        private static IQueryPlanNode PlanForOrderBy(IQueryPlanNode plan, IList<SortColumn> orderBy, QueryExpressionFrom queryFrom, IList<SelectColumn> selectedColumns)
        {
            // Sort on the ORDER BY clause
            if (orderBy.Count > 0) {
                int sz = orderBy.Count;
                var orderList = new ObjectName[sz];
                var ascendingList = new bool[sz];

                var functionOrders = new List<SqlExpression>();

                for (int i = 0; i < sz; ++i) {
                    var column = orderBy[i];
                    SqlExpression exp = column.Expression;
                    ascendingList[i] = column.Ascending;
                    var v = exp.AsReferenceName();

                    if (v != null) {
                        var newV = queryFrom.ResolveReference(v);
                        if (newV == null)
                            throw new InvalidOperationException(String.Format("Could not resolve ORDER BY column '{0}' in expression", v));

                        newV = ReplaceAliasedVariable(newV, selectedColumns);
                        orderList[i] = newV;
                    } else {
                        // Otherwise we must be ordering by an expression such as
                        // '0 - a'.

                        // Resolve the expression,
                        exp = exp.Prepare(queryFrom.ExpressionPreparer);

                        // Make sure we substitute any aliased columns in the order by
                        // columns.
                        exp = ReplaceAliasedVariables(exp, selectedColumns);

                        // The new ordering functions are called 'FUNCTIONTABLE.#ORDER-n'
                        // where n is the number of the ordering expression.
                        orderList[i] = new ObjectName(FunctionTableName, "#ORDER-" + functionOrders.Count);
                        functionOrders.Add(exp);
                    }
                }

                // If there are functional orderings,
                // For this we must define a new FunctionTable with the expressions,
                // then order by those columns, and then use another SubsetNode
                // command node.
                int fsz = functionOrders.Count;
                if (fsz > 0) {
                    var funs = new SqlExpression[fsz];
                    var fnames = new String[fsz];
                    for (int n = 0; n < fsz; ++n) {
                        funs[n] = functionOrders[n];
                        fnames[n] = "#ORDER-" + n;
                    }

                    if (plan is SubsetNode) {
                        // If the top plan is a SubsetNode then we use the
                        //   information from it to create a new SubsetNode that
                        //   doesn't include the functional orders we have attached here.
                        var topSubsetNode = (SubsetNode)plan;
                        var mappedNames = topSubsetNode.AliasColumnNames;

                        // Defines the sort functions
                        plan = new CreateFunctionsNode(plan, funs, fnames);
                        // Then plan the sort
                        plan = new SortNode(plan, orderList, ascendingList);
                        // Then plan the subset
                        plan = new SubsetNode(plan, mappedNames, mappedNames);
                    } else {
                        // Defines the sort functions
                        plan = new CreateFunctionsNode(plan, funs, fnames);
                        // Plan the sort
                        plan = new SortNode(plan, orderList, ascendingList);
                    }

                } else {
                    // No functional orders so we only need to sort by the columns
                    // defined.
                    plan = new SortNode(plan, orderList, ascendingList);
                }
            }

            return plan;
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:83,代码来源:QueryPlanner.cs



注:本文中的IQueryPlanNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IQuerySource类代码示例发布时间:2022-05-24
下一篇:
C# IQueryContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap