Exemplo n.º 1
0
 public HashMatchIterator(BoundHashMatchOperator logicalOperator, Iterator build, Iterator probe, int buildIndex, int probeIndex, IteratorPredicate remainder, HashMatchRowBuffer rowBuffer)
 {
     _logicalOperator = logicalOperator;
     _build           = build;
     _probe           = probe;
     _buildIndex      = buildIndex;
     _probeIndex      = probeIndex;
     _remainder       = remainder;
     _rowBuffer       = rowBuffer;
 }
Exemplo n.º 2
0
        private Iterator BuildHashMatch(BoundHashMatchRelation relation)
        {
            var build           = BuildRelation(relation.Build);
            var buildAllocation = BuildRowBufferAllocation(relation.Build, build.RowBuffer);
            var buildEntry      = buildAllocation[relation.BuildKey];

            var probe           = BuildRelation(relation.Probe);
            var probeAllocation = BuildRowBufferAllocation(relation.Probe, probe.RowBuffer);
            var probeEntry      = probeAllocation[relation.ProbeKey];

            var outputRowBuffer  = new HashMatchRowBuffer(build.RowBuffer.Count, probe.RowBuffer.Count);
            var outputAllocation = BuildRowBufferAllocation(relation, outputRowBuffer);
            var predicate        = BuildPredicate(relation.Remainder, true, outputAllocation);

            Debug.Assert(buildEntry.RowBuffer == build.RowBuffer);
            Debug.Assert(probeEntry.RowBuffer == probe.RowBuffer);

            return(new HashMatchIterator(relation.LogicalOperator, build, probe, buildEntry.Index, probeEntry.Index, predicate, outputRowBuffer));
        }