org.apache.hadoop.hive.ql.exec.vector.VectorSMBMapJoinOperator Maven / Gradle / Ivy
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.hive.ql.exec.vector;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator;
import org.apache.hadoop.hive.ql.exec.SMBMapJoinOperator;
import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression;
import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriter;
import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpressionWriterFactory;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
import org.apache.hadoop.hive.ql.plan.OperatorDesc;
import org.apache.hadoop.hive.ql.plan.SMBJoinDesc;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
/**
* VectorSMBJoinOperator.
* Implements the vectorized SMB join operator. The implementation relies on the row-mode SMB join operator.
* It accepts a vectorized batch input from the big table and iterates over the batch, calling the parent row-mode
* implementation for each row in the batch.
*/
public class VectorSMBMapJoinOperator extends SMBMapJoinOperator implements VectorizationContextRegion {
private static final Log LOG = LogFactory.getLog(
VectorSMBMapJoinOperator.class.getName());
private static final long serialVersionUID = 1L;
private VectorExpression[] bigTableValueExpressions;
private VectorExpression[] bigTableFilterExpressions;
private VectorExpression[] keyExpressions;
private VectorExpressionWriter[] keyOutputWriters;
private VectorizationContext vOutContext;
// The above members are initialized by the constructor and must not be
// transient.
//---------------------------------------------------------------------------
private transient VectorizedRowBatch outputBatch;
private transient VectorizedRowBatchCtx vrbCtx = null;
private transient VectorHashKeyWrapperBatch keyWrapperBatch;
private transient Map outputVectorAssignRowMap;
private transient int batchIndex = -1;
private transient VectorHashKeyWrapper[] keyValues;
private transient SMBJoinKeyEvaluator keyEvaluator;
private transient VectorExpressionWriter[] valueWriters;
private interface SMBJoinKeyEvaluator {
List