use of com.sap.hadoop.windowing.functions2.TableFunctionEvaluator in project SQLWindowing by hbutani.
the class QueryDefDeserializer method visit.
/*
* 1. Invoke setupOI on the TableFunctionEvaluator
* 2. Setup serde and OI on the table function definition
* 3. Add the table function definition to input map
* on the query translation info
* 4. Reset the inputInfo to the one associated
* with this table function definition.
*/
@Override
public void visit(TableFuncDef tblFuncDef) throws WindowingException {
TableFunctionEvaluator tEval = tblFuncDef.getFunction();
currentTFnResolver.setupOutputOI();
TranslateUtils.setupSerdeAndOI(tblFuncDef, qInDef, tInfo, tEval);
tInfo.addInput(tblFuncDef);
inputInfo = qDef.getTranslationInfo().getInputInfo(tblFuncDef);
}
use of com.sap.hadoop.windowing.functions2.TableFunctionEvaluator in project SQLWindowing by hbutani.
the class MRUtils method addPTFMapOperator.
/**
* Returns true if the query needs a map-side reshape. PTFOperator is added
* on the map-side before ReduceSinkOperator in this scenario.
*
* @param qdef
* @return
* @throws WindowingException
*/
public static boolean addPTFMapOperator(QueryDef qdef) throws WindowingException {
boolean hasMap = false;
TableFuncDef tabDef = RuntimeUtils.getFirstTableFunction(qdef);
TableFunctionEvaluator tEval = tabDef.getFunction();
if (tEval.isTransformsRawInput()) {
hasMap = true;
}
return hasMap;
}
use of com.sap.hadoop.windowing.functions2.TableFunctionEvaluator in project SQLWindowing by hbutani.
the class RuntimeUtils method createFirstPartitionForChain.
/**
* Create a new partition.
* The input OI is used to evaluate rows appended to the partition.
* The serde is determined based on whether the query has a map-phase
* or not. The OI on the serde is used by PTFs to evaluate output of the
* partition.
* @param qDef
* @param oi
* @param hiveConf
* @return
* @throws WindowingException
*/
public static Partition createFirstPartitionForChain(QueryDef qDef, ObjectInspector oi, HiveConf hiveConf, boolean isMapSide) throws WindowingException {
TableFuncDef tabDef = getFirstTableFunction(qDef);
TableFunctionEvaluator tEval = tabDef.getFunction();
String partClassName = tEval.getPartitionClass();
int partMemSize = tEval.getPartitionMemSize();
Partition part = null;
SerDe serde = tabDef.getInput().getSerde();
part = new Partition(partClassName, partMemSize, serde, (StructObjectInspector) oi);
return part;
}
Aggregations