Beispiel #1
0
 public ExchangeNode(PlanNodeId id, ExchangeType type, ExchangeScope scope, PartitioningScheme partitioningScheme, IEnumerable <PlanNode> sources, IEnumerable <List <Symbol> > inputs) : base(id)
 {
     this.Type  = type;
     this.Scope = scope;
     this.PartitioningScheme = partitioningScheme ?? throw new ArgumentNullException("partitioningScheme");
     this.Sources            = sources ?? throw new ArgumentNullException("sources");
     this.Inputs             = inputs ?? throw new ArgumentNullException("inputs");
 }
Beispiel #2
0
        public TableWriterNode(PlanNodeId id, PlanNode source, WriterTarget target, IEnumerable <Symbol> outputs, IEnumerable <Symbol> columns, IEnumerable <string> columnNames, PartitioningScheme partitioningScheme) : base(id)
        {
            this.Source      = source ?? throw new ArgumentNullException("source");
            this.Target      = target ?? throw new ArgumentNullException("target");
            this.Columns     = columns ?? throw new ArgumentNullException("columns");
            this.ColumnNames = columnNames ?? throw new ArgumentNullException("columnNames");

            if (this.Columns.Count() != this.ColumnNames.Count())
            {
                throw new ArgumentException("Columns and column names sizes don't match.");
            }

            this.Outputs            = outputs ?? throw new ArgumentNullException("outputs");
            this.PartitioningScheme = partitioningScheme;
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            JToken Tokens = JToken.Load(reader);

            // These two are native to the flattened plan
            string TextPlan = Tokens["textPlan"].ToString();
            IEnumerable <FlattenedNode> Nodes = Tokens["nodes"].ToObject <IEnumerable <FlattenedNode> >();

            // These properties are derived from the PlanFragment
            PlanFragmentId Id   = new PlanFragmentId(Tokens["id"].ToObject <string>(serializer));
            PlanNode       Root = Tokens["tree"].ToObject <PlanNode>(serializer);
            IDictionary <string, string> Symbols            = Tokens["symbols"].ToObject <Dictionary <string, string> >(serializer);
            PartitioningHandle           Partitioning       = Tokens["partitioning"].ToObject <PartitioningHandle>(serializer);
            IEnumerable <PlanNodeId>     PartitionedSources = Tokens["partitionedSources"].ToObject <IEnumerable <PlanNodeId> >(serializer);
            PartitioningScheme           PartitioningScheme = Tokens["partitioningScheme"].ToObject <PartitioningScheme>(serializer);

            // The pipeline execution strategy doesn't really matter because the flattened plan doesn't expose it
            PlanFragment Fragment = new PlanFragment(Id, Root, Symbols, Partitioning, PartitionedSources, PartitioningScheme, PipelineExecutionStrategy.UNGROUPED_EXECUTION);

            return(new FlattenedPlanFragment(TextPlan, Fragment, Nodes));
        }