Search in sources :

Example 6 with IMissingWriterFactory

use of org.apache.hyracks.api.dataflow.value.IMissingWriterFactory in project asterixdb by apache.

the class JoinMultiComparator method generateOptimizedHashJoinRuntime.

private IOperatorDescriptor generateOptimizedHashJoinRuntime(JobGenContext context, IOperatorSchema[] inputSchemas, int[] keysLeft, int[] keysRight, IBinaryHashFunctionFamily[] hashFunFamilies, IBinaryComparatorFactory[] comparatorFactories, IPredicateEvaluatorFactory predEvaluatorFactory, RecordDescriptor recDescriptor, IOperatorDescriptorRegistry spec) throws AlgebricksException {
    IOperatorDescriptor opDesc;
    try {
        switch(kind) {
            case INNER:
                opDesc = new OptimizedHybridHashJoinOperatorDescriptor(spec, getMemSizeInFrames(), maxInputBuildSizeInFrames, getFudgeFactor(), keysLeft, keysRight, hashFunFamilies, comparatorFactories, recDescriptor, new JoinMultiComparatorFactory(comparatorFactories, keysLeft, keysRight), new JoinMultiComparatorFactory(comparatorFactories, keysRight, keysLeft), predEvaluatorFactory);
                break;
            case LEFT_OUTER:
                IMissingWriterFactory[] nonMatchWriterFactories = new IMissingWriterFactory[inputSchemas[1].getSize()];
                for (int j = 0; j < nonMatchWriterFactories.length; j++) {
                    nonMatchWriterFactories[j] = context.getMissingWriterFactory();
                }
                opDesc = new OptimizedHybridHashJoinOperatorDescriptor(spec, getMemSizeInFrames(), maxInputBuildSizeInFrames, getFudgeFactor(), keysLeft, keysRight, hashFunFamilies, comparatorFactories, recDescriptor, new JoinMultiComparatorFactory(comparatorFactories, keysLeft, keysRight), new JoinMultiComparatorFactory(comparatorFactories, keysRight, keysLeft), predEvaluatorFactory, true, nonMatchWriterFactories);
                break;
            default:
                throw new NotImplementedException();
        }
    } catch (HyracksDataException e) {
        throw new AlgebricksException(e);
    }
    return opDesc;
}
Also used : OptimizedHybridHashJoinOperatorDescriptor(org.apache.hyracks.dataflow.std.join.OptimizedHybridHashJoinOperatorDescriptor) IOperatorDescriptor(org.apache.hyracks.api.dataflow.IOperatorDescriptor) IMissingWriterFactory(org.apache.hyracks.api.dataflow.value.IMissingWriterFactory) NotImplementedException(org.apache.hyracks.algebricks.common.exceptions.NotImplementedException) AlgebricksException(org.apache.hyracks.algebricks.common.exceptions.AlgebricksException) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException)

Aggregations

IMissingWriterFactory (org.apache.hyracks.api.dataflow.value.IMissingWriterFactory)6 IOperatorDescriptor (org.apache.hyracks.api.dataflow.IOperatorDescriptor)5 RecordDescriptor (org.apache.hyracks.api.dataflow.value.RecordDescriptor)4 NotImplementedException (org.apache.hyracks.algebricks.common.exceptions.NotImplementedException)3 IConnectorDescriptor (org.apache.hyracks.api.dataflow.IConnectorDescriptor)3 ResultSetId (org.apache.hyracks.api.dataset.ResultSetId)3 FileSplit (org.apache.hyracks.api.io.FileSplit)3 ManagedFileSplit (org.apache.hyracks.api.io.ManagedFileSplit)3 JobSpecification (org.apache.hyracks.api.job.JobSpecification)3 UTF8StringSerializerDeserializer (org.apache.hyracks.dataflow.common.data.marshalling.UTF8StringSerializerDeserializer)3 IValueParserFactory (org.apache.hyracks.dataflow.common.data.parsers.IValueParserFactory)3 MToNBroadcastConnectorDescriptor (org.apache.hyracks.dataflow.std.connectors.MToNBroadcastConnectorDescriptor)3 OneToOneConnectorDescriptor (org.apache.hyracks.dataflow.std.connectors.OneToOneConnectorDescriptor)3 ConstantFileSplitProvider (org.apache.hyracks.dataflow.std.file.ConstantFileSplitProvider)3 DelimitedDataTupleParserFactory (org.apache.hyracks.dataflow.std.file.DelimitedDataTupleParserFactory)3 FileScanOperatorDescriptor (org.apache.hyracks.dataflow.std.file.FileScanOperatorDescriptor)3 IFileSplitProvider (org.apache.hyracks.dataflow.std.file.IFileSplitProvider)3 ResultWriterOperatorDescriptor (org.apache.hyracks.dataflow.std.result.ResultWriterOperatorDescriptor)3 Test (org.junit.Test)3 AlgebricksException (org.apache.hyracks.algebricks.common.exceptions.AlgebricksException)2