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); }
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()); }
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); }
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; }
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; }
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(); }