/** * Evaluate equal node. * * * @param node * @param skewedCols * @param cell * @param uniqSkewedValues * @return * @throws SemanticException */ private static Boolean evaluateEqualNd(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { Boolean result = null; List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); assert ((children != null) && (children.size() == 2)) : "GenericUDFOPEqual should have 2 " + "ExprNodeDesc. Node name : " + node.getName(); ExprNodeDesc left = children.get(0); ExprNodeDesc right = children.get(1); assert (left instanceof ExprNodeColumnDesc && right instanceof ExprNodeConstantDesc) : "GenericUDFOPEqual should have 2 children: " + " the first is ExprNodeColumnDesc and the second is ExprNodeConstantDesc. " + "But this one, the first one is " + left.getName() + " and the second is " + right.getName(); result = startComparisonInEqualNode(skewedCols, cell, uniqSkewedValues, result, left, right); return result; }
/** * Evaluate equal node. * * * @param node * @param skewedCols * @param cell * @param uniqSkewedValues * @return * @throws SemanticException */ private static Boolean evaluateEqualNd(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { Boolean result = null; List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); assert ((children != null) && (children.size() == 2)) : "GenericUDFOPEqual should have 2 " + "ExprNodeDesc. Node name : " + node.getName(); ExprNodeDesc left = children.get(0); ExprNodeDesc right = children.get(1); assert (left instanceof ExprNodeColumnDesc && right instanceof ExprNodeConstantDesc) : "GenericUDFOPEqual should have 2 children: " + " the first is ExprNodeColumnDesc and the second is ExprNodeConstantDesc. " + "But this one, the first one is " + left.getName() + " and the second is " + right.getName(); result = startComparisonInEqualNode(skewedCols, cell, uniqSkewedValues, result, left, right); return result; }
private static Boolean evaluateNotNode(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); if ((children == null) || (children.size() != 1)) { throw new SemanticException("GenericUDFOPNot should have 1 ExprNodeDesc. Node name : " + node.getName()); } ExprNodeDesc child = children.get(0); return notBoolOperand(recursiveExpr(child, skewedCols, cell, uniqSkewedValues)); }
private static Boolean evaluateOrNode(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); if ((children == null) || (children.size() != 2)) { throw new SemanticException("GenericUDFOPOr should have 2 ExprNodeDesc. Node name : " + node.getName()); } ExprNodeDesc left = children.get(0); ExprNodeDesc right = children.get(1); return orBoolOperand(recursiveExpr(left, skewedCols, cell, uniqSkewedValues), recursiveExpr(right, skewedCols, cell, uniqSkewedValues)); }
private static Boolean evaluateAndNode(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); if ((children == null) || (children.size() != 2)) { throw new SemanticException("GenericUDFOPAnd should have 2 ExprNodeDesc. Node name : " + node.getName()); } ExprNodeDesc left = children.get(0); ExprNodeDesc right = children.get(1); return andBoolOperand(recursiveExpr(left, skewedCols, cell, uniqSkewedValues), recursiveExpr(right, skewedCols, cell, uniqSkewedValues)); }
private static Boolean evaluateNotNode(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); if ((children == null) || (children.size() != 1)) { throw new SemanticException("GenericUDFOPNot should have 1 ExprNodeDesc. Node name : " + node.getName()); } ExprNodeDesc child = children.get(0); return notBoolOperand(recursiveExpr(child, skewedCols, cell, uniqSkewedValues)); }
private static Boolean evaluateOrNode(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); if ((children == null) || (children.size() != 2)) { throw new SemanticException("GenericUDFOPOr should have 2 ExprNodeDesc. Node name : " + node.getName()); } ExprNodeDesc left = children.get(0); ExprNodeDesc right = children.get(1); return orBoolOperand(recursiveExpr(left, skewedCols, cell, uniqSkewedValues), recursiveExpr(right, skewedCols, cell, uniqSkewedValues)); }
private static Boolean evaluateAndNode(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); if ((children == null) || (children.size() != 2)) { throw new SemanticException("GenericUDFOPAnd should have 2 ExprNodeDesc. Node name : " + node.getName()); } ExprNodeDesc left = children.get(0); ExprNodeDesc right = children.get(1); return andBoolOperand(recursiveExpr(left, skewedCols, cell, uniqSkewedValues), recursiveExpr(right, skewedCols, cell, uniqSkewedValues)); }
.put(Utilities.ReduceField.KEY + "." + exprNodeDesc.getExprString(), exprNodeDesc); nameMapping.put(exprNodeDesc.getExprString(), Utilities.ReduceField.KEY + "." + exprNodeDesc.getName() ); }); .put(Utilities.ReduceField.VALUE + "." + exprNodeDesc.getExprString(), exprNodeDesc); nameMapping.put(exprNodeDesc.getExprString(), Utilities.ReduceField.VALUE + "." + exprNodeDesc.getName() ); });
ExprNodeDesc colExpr = new ExprNodeColumnDesc(col); colList.add(colExpr); colNames.add(colExpr.getName()); lvfColExprMap.put(col.getInternalName(), colExpr); selColExprMap.put(col.getInternalName(), colExpr.clone());
ExprNodeDesc colExpr = new ExprNodeColumnDesc(col); colList.add(colExpr); colNames.add(colExpr.getName()); lvfColExprMap.put(col.getInternalName(), colExpr); selColExprMap.put(col.getInternalName(), colExpr.clone());
/** * Evaluate equal node. * * * @param node * @param skewedCols * @param cell * @param uniqSkewedValues * @return * @throws SemanticException */ private static Boolean evaluateEqualNd(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { Boolean result = null; List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); assert ((children != null) && (children.size() == 2)) : "GenericUDFOPEqual should have 2 " + "ExprNodeDesc. Node name : " + node.getName(); ExprNodeDesc left = children.get(0); ExprNodeDesc right = children.get(1); assert (left instanceof ExprNodeColumnDesc && right instanceof ExprNodeConstantDesc) : "GenericUDFOPEqual should have 2 children: " + " the first is ExprNodeColumnDesc and the second is ExprNodeConstantDesc. " + "But this one, the first one is " + left.getName() + " and the second is " + right.getName(); result = startComparisonInEqualNode(skewedCols, cell, uniqSkewedValues, result, left, right); return result; }
private static Boolean evaluateOrNode(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); if ((children == null) || (children.size() != 2)) { throw new SemanticException("GenericUDFOPOr should have 2 ExprNodeDesc. Node name : " + node.getName()); } ExprNodeDesc left = children.get(0); ExprNodeDesc right = children.get(1); return orBoolOperand(recursiveExpr(left, skewedCols, cell, uniqSkewedValues), recursiveExpr(right, skewedCols, cell, uniqSkewedValues)); }
private static Boolean evaluateNotNode(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); if ((children == null) || (children.size() != 1)) { throw new SemanticException("GenericUDFOPNot should have 1 ExprNodeDesc. Node name : " + node.getName()); } ExprNodeDesc child = children.get(0); return notBoolOperand(recursiveExpr(child, skewedCols, cell, uniqSkewedValues)); }
private static Boolean evaluateAndNode(final ExprNodeDesc node, final List<String> skewedCols, final List<String> cell, final List<List<String>> uniqSkewedValues) throws SemanticException { List<ExprNodeDesc> children = ((ExprNodeGenericFuncDesc) node).getChildren(); if ((children == null) || (children.size() != 2)) { throw new SemanticException("GenericUDFOPAnd should have 2 ExprNodeDesc. Node name : " + node.getName()); } ExprNodeDesc left = children.get(0); ExprNodeDesc right = children.get(1); return andBoolOperand(recursiveExpr(left, skewedCols, cell, uniqSkewedValues), recursiveExpr(right, skewedCols, cell, uniqSkewedValues)); }
ExprNodeDesc colExpr = new ExprNodeColumnDesc(col); colList.add(colExpr); colNames.add(colExpr.getName()); lvfColExprMap.put(col.getInternalName(), colExpr); selColExprMap.put(col.getInternalName(), colExpr.clone());
throw new HiveException("Could not vectorize expression: "+exprDesc.getName());