Exemple #1
0
        public override AlgebraNode VisitConcatAlgebraNode(ConcatAlgebraNode node)
        {
            ConcatenationIterator concatenationIterator = new ConcatenationIterator();

            concatenationIterator.RowBuffer   = new object[node.OutputList.Length];
            concatenationIterator.Inputs      = new Iterator[node.Inputs.Length];
            concatenationIterator.InputOutput = new IteratorOutput[node.Inputs.Length][];
            for (int i = 0; i < concatenationIterator.Inputs.Length; i++)
            {
                concatenationIterator.Inputs[i] = ConvertAlgebraNode(node.Inputs[i]);

                List <IteratorOutput> inputOutputList = new List <IteratorOutput>();
                foreach (UnitedValueDefinition unitedValueDefinition in node.DefinedValues)
                {
                    IteratorOutput iteratorOutput = new IteratorOutput();
                    iteratorOutput.SourceIndex = Array.IndexOf(node.Inputs[i].OutputList, unitedValueDefinition.DependendEntries[i]);
                    iteratorOutput.TargetIndex = Array.IndexOf(node.OutputList, unitedValueDefinition.Target);
                    inputOutputList.Add(iteratorOutput);
                }
                concatenationIterator.InputOutput[i] = inputOutputList.ToArray();
            }
            SetLastIterator(node, concatenationIterator);

            return(node);
        }
Exemple #2
0
        private static IteratorOutput[] GetIteratorOutput(int offset, RowBufferEntry[] allEntries, RowBufferEntry[] neededEntries)
        {
            List <IteratorOutput> result = new List <IteratorOutput>(neededEntries.Length);

            for (int i = 0; i < allEntries.Length; i++)
            {
                if (ArrayHelpers.Contains(neededEntries, allEntries[i]))
                {
                    IteratorOutput iteratorOutput = new IteratorOutput();
                    iteratorOutput.SourceIndex = i;
                    iteratorOutput.TargetIndex = offset + result.Count;
                    result.Add(iteratorOutput);
                }
            }

            return(result.ToArray());
        }
Exemple #3
0
        public override AlgebraNode VisitResultAlgebraNode(ResultAlgebraNode node)
        {
            ResultIterator resultIterator = new ResultIterator();

            resultIterator.RowBuffer   = new object[node.OutputList.Length];
            resultIterator.Input       = ConvertAlgebraNode(node.Input);
            resultIterator.InputOutput = new IteratorOutput[node.OutputList.Length];
            resultIterator.ColumnNames = new string[node.OutputList.Length];
            resultIterator.ColumnTypes = new Type[node.OutputList.Length];
            for (int i = 0; i < node.OutputList.Length; i++)
            {
                IteratorOutput iteratorOutput = new IteratorOutput();
                iteratorOutput.SourceIndex    = Array.IndexOf(node.Input.OutputList, node.OutputList[i]);
                iteratorOutput.TargetIndex    = i;
                resultIterator.InputOutput[i] = iteratorOutput;
                resultIterator.ColumnNames[i] = node.ColumnNames[i];
                resultIterator.ColumnTypes[i] = node.OutputList[i].DataType;
            }
            SetLastIterator(node, resultIterator);

            return(node);
        }
Exemple #4
0
		public override AlgebraNode VisitResultAlgebraNode(ResultAlgebraNode node)
		{
			ResultIterator resultIterator = new ResultIterator();
			resultIterator.RowBuffer = new object[node.OutputList.Length];
			resultIterator.Input = ConvertAlgebraNode(node.Input);
			resultIterator.InputOutput = new IteratorOutput[node.OutputList.Length];
			resultIterator.ColumnNames = new string[node.OutputList.Length];
			resultIterator.ColumnTypes = new Type[node.OutputList.Length];
			for (int i = 0; i < node.OutputList.Length; i++)
			{
				IteratorOutput iteratorOutput = new IteratorOutput();
				iteratorOutput.SourceIndex = Array.IndexOf(node.Input.OutputList, node.OutputList[i]);
				iteratorOutput.TargetIndex = i;
				resultIterator.InputOutput[i] = iteratorOutput;
				resultIterator.ColumnNames[i] = node.ColumnNames[i];
				resultIterator.ColumnTypes[i] = node.OutputList[i].DataType;
			}
			SetLastIterator(node, resultIterator);

			return node;
		}
Exemple #5
0
		public override AlgebraNode VisitConcatAlgebraNode(ConcatAlgebraNode node)
		{
			ConcatenationIterator concatenationIterator = new ConcatenationIterator();
			concatenationIterator.RowBuffer = new object[node.OutputList.Length];
			concatenationIterator.Inputs = new Iterator[node.Inputs.Length];
			concatenationIterator.InputOutput = new IteratorOutput[node.Inputs.Length][];
			for (int i = 0; i < concatenationIterator.Inputs.Length; i++)
			{
				concatenationIterator.Inputs[i] = ConvertAlgebraNode(node.Inputs[i]);

				List<IteratorOutput> inputOutputList = new List<IteratorOutput>();
				foreach (UnitedValueDefinition unitedValueDefinition in node.DefinedValues)
				{
					IteratorOutput iteratorOutput = new IteratorOutput();
					iteratorOutput.SourceIndex = Array.IndexOf(node.Inputs[i].OutputList, unitedValueDefinition.DependendEntries[i]);
					iteratorOutput.TargetIndex = Array.IndexOf(node.OutputList, unitedValueDefinition.Target);
					inputOutputList.Add(iteratorOutput);
				}
				concatenationIterator.InputOutput[i] = inputOutputList.ToArray();
			}
			SetLastIterator(node, concatenationIterator);

			return node;
		}
Exemple #6
0
		private static IteratorOutput[] GetIteratorOutput(int offset, RowBufferEntry[] allEntries, RowBufferEntry[] neededEntries)
		{
			List<IteratorOutput> result = new List<IteratorOutput>(neededEntries.Length);

			for (int i = 0; i < allEntries.Length; i++)
			{
				if (ArrayHelpers.Contains(neededEntries, allEntries[i]))
				{
					IteratorOutput iteratorOutput = new IteratorOutput();
					iteratorOutput.SourceIndex = i;
					iteratorOutput.TargetIndex = offset + result.Count;
					result.Add(iteratorOutput);
				}
			}

			return result.ToArray();
		}