VectorUDFAdaptor ve = new VectorUDFAdaptor(expr, outputColumnNum, resultTypeName, argDescs); ve.setSuppressEvaluateExceptions(adaptorSuppressEvaluateExceptions); ve.setChildExpressions(childVEs); ve.setInputTypeInfos(inputTypeInfos); ve.setInputDataTypePhysicalVariations(inputDataTypePhysicalVariations); ve.setOutputTypeInfo(resultTypeInfo); ve.setOutputDataTypePhysicalVariation(DataTypePhysicalVariation.NONE); filterVectorExpr.setInputTypeInfos(ve.getOutputTypeInfo()); filterVectorExpr.setInputDataTypePhysicalVariations(ve.getOutputDataTypePhysicalVariation());
init(); } catch (Exception e) { throw new RuntimeException(e); if (allInputColsRepeating(batch)) { setResult(0, batch); batch.cols[outputColumnNum].isRepeating = true; return; for(int j = 0; j != n; j++) { int i = sel[j]; setResult(i, batch); setResult(i, batch);
private void setResult(int i, VectorizedRowBatch b) { // get arguments for (int j = 0; j < argDescs.length; j++) { deferredChildren[j] = argDescs[j].getDeferredJavaObject(i, b, j, writers); } // call function Object result; try { result = genericUDF.evaluate(deferredChildren); } catch (HiveException e) { /* For UDFs that expect primitive types (like int instead of Integer or IntWritable), * this will catch the the exception that happens if they are passed a NULL value. * Then the default NULL handling logic will apply, and the result will be NULL. */ result = null; } // set output column vector entry if (result == null) { b.cols[outputColumn].noNulls = false; b.cols[outputColumn].isNull[i] = true; } else { b.cols[outputColumn].isNull[i] = false; setOutputCol(b.cols[outputColumn], i, result); } }
vudf = new VectorUDFAdaptor(funcDesc, 3, "String", argDescs); } catch (HiveException e) { vudf.evaluate(b); byte[] result = null; byte[] result2 = null; vudf.evaluate(b); out = (BytesColumnVector) b.cols[3]; assertFalse(out.noNulls); b.cols[1].isRepeating = true; b.cols[2].isRepeating = true; vudf.evaluate(b);
VectorExpression ve = new VectorUDFAdaptor(expr, outputCol, resultTypeName, argDescs);
if (parent instanceof VectorUDFAdaptor) { VectorUDFAdaptor parentAdaptor = (VectorUDFAdaptor) parent; VectorUDFArgDesc[] argDescs = parentAdaptor.getArgDescs(); for (VectorUDFArgDesc argDesc : argDescs) { if (argDesc.getColumnNum() == oldExpression.getOutputColumnNum()) {
vudf = new VectorUDFAdaptor(funcDesc, 3, "String", argDescs); } catch (HiveException e) { b.cols[0].noNulls = false; b.cols[0].isNull[0] = true; // set 1st entry to null vudf.evaluate(b); out = (BytesColumnVector) b.cols[3];
VectorExpression ve = new VectorUDFAdaptor(expr, outputCol, normalizedName, argDescs);
init(); } catch (Exception e) { throw new RuntimeException(e); if (allInputColsRepeating(batch)) { setResult(0, batch); batch.cols[outputColumn].isRepeating = true; return; for(int j = 0; j != n; j++) { int i = sel[j]; setResult(i, batch); setResult(i, batch);
vudf = new VectorUDFAdaptor(funcDesc, 1, "Long", argDescs); } catch (HiveException e) { vudf.evaluate(b); out = (LongColumnVector) b.cols[1]; b.cols[0].noNulls = false; vudf.evaluate(b); assertFalse(out.noNulls); assertEquals(1000, out.vector[0]); out = (LongColumnVector) b.cols[1]; b.cols[0].isRepeating = true; vudf.evaluate(b);
private void setResult(int i, VectorizedRowBatch b) { // get arguments for (int j = 0; j < argDescs.length; j++) { deferredChildren[j] = argDescs[j].getDeferredJavaObject(i, b, j, writers); } // call function Object result; try { result = genericUDF.evaluate(deferredChildren); } catch (HiveException e) { /* For UDFs that expect primitive types (like int instead of Integer or IntWritable), * this will catch the the exception that happens if they are passed a NULL value. * Then the default NULL handling logic will apply, and the result will be NULL. */ result = null; } // set output column vector entry if (result == null) { b.cols[outputColumn].noNulls = false; b.cols[outputColumn].isNull[i] = true; } else { b.cols[outputColumn].isNull[i] = false; setOutputCol(b.cols[outputColumn], i, result); } }
init(); } catch (Exception e) { throw new RuntimeException(e); if (allInputColsRepeating(batch)) { setResult(0, batch); batch.cols[outputColumn].isRepeating = true; return; for(int j = 0; j != n; j++) { int i = sel[j]; setResult(i, batch); setResult(i, batch);