public StructObjectInspector initialize()

in src/main/java/org/apache/datasketches/hive/tuple/ArrayOfDoublesSketchToValuesUDTF.java [53:76]


  public StructObjectInspector initialize(final ObjectInspector[] inspectors) throws UDFArgumentException {
    if (inspectors.length != 1) {
      throw new UDFArgumentException("One argument expected");
    }
    if (inspectors[0].getCategory() != ObjectInspector.Category.PRIMITIVE) {
      throw new UDFArgumentTypeException(0, "Primitive argument expected, but "
          + inspectors[0].getCategory().name() + " was recieved");
    }
    this.inputObjectInspector = (PrimitiveObjectInspector) inspectors[0];
    if (this.inputObjectInspector.getPrimitiveCategory()
        != PrimitiveObjectInspector.PrimitiveCategory.BINARY) {
      throw new UDFArgumentTypeException(0, "Binary value expected as the first argument, but "
          + this.inputObjectInspector.getPrimitiveCategory().name() + " was recieved");
    }

    return ObjectInspectorFactory.getStandardStructObjectInspector(
      Arrays.asList("values"),
      Arrays.asList(
        ObjectInspectorFactory.getStandardListObjectInspector(
          PrimitiveObjectInspectorFactory.javaDoubleObjectInspector
        )
      )
    );
  }