use of com.sap.hadoop.windowing.query2.specification.ColumnSpec in project SQLWindowing by hbutani.
the class WindowSpecTranslation method translatePartitionColumn.
static ColumnDef translatePartitionColumn(QueryDef qDef, InputInfo iInfo, ColumnSpec cSpec) throws WindowingException {
ColumnDef cDef = new ColumnDef(cSpec);
translateColumn(qDef, cDef, iInfo, cSpec);
TranslateUtils.validateComparable(cDef.getOI(), sprintf("Partition Column %s is not comparable", cSpec));
return cDef;
}
use of com.sap.hadoop.windowing.query2.specification.ColumnSpec in project SQLWindowing by hbutani.
the class WindowSpecTranslation method translatePartition.
static PartitionDef translatePartition(QueryDef qDef, InputInfo iInfo, PartitionSpec spec) throws WindowingException {
if (spec == null || spec.getColumns() == null || spec.getColumns().size() == 0)
return null;
PartitionDef pDef = new PartitionDef(spec);
for (ColumnSpec colSpec : spec.getColumns()) {
ColumnDef cDef = translatePartitionColumn(qDef, iInfo, colSpec);
pDef.addColumn(cDef);
}
return pDef;
}
use of com.sap.hadoop.windowing.query2.specification.ColumnSpec in project SQLWindowing by hbutani.
the class OutputTranslation method translateSelectExpr.
public static ColumnDef translateSelectExpr(QueryDef qDef, InputInfo iInfo, int colIdx, String alias, ASTNode expr) throws WindowingException {
ColumnDef cDef = new ColumnDef((ColumnSpec) null);
ExprNodeDesc exprNode = TranslateUtils.buildExprNode(expr, iInfo.getTypeCheckCtx());
ExprNodeEvaluator exprEval = WindowingExprNodeEvaluatorFactory.get(qDef.getTranslationInfo(), exprNode);
ObjectInspector oi = TranslateUtils.initExprNodeEvaluator(qDef, exprNode, exprEval, iInfo);
cDef.setExpression(expr);
cDef.setExprNode(exprNode);
cDef.setExprEvaluator(exprEval);
cDef.setOI(oi);
cDef.setAlias(getAlias(alias, expr, colIdx));
return cDef;
}
Aggregations