@Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
    if (arguments.length != 2) {
      throw new UDFArgumentLengthException(
              "InBloomFilter requires exactly 2 arguments but got " + arguments.length);
    }

    // Verify individual arguments
    if (arguments[0].getCategory() != ObjectInspector.Category.PRIMITIVE) {
      throw new UDFArgumentTypeException(0, "The 1st argument must be a primitive type but "
      + arguments[0].getTypeName() + " was passed");
    }

    if (((PrimitiveObjectInspector) arguments[1]).getPrimitiveCategory() !=
            PrimitiveObjectInspector.PrimitiveCategory.BINARY) {
      throw new UDFArgumentTypeException(1, "The 2nd argument must be a binary type but " +
      arguments[1].getTypeName() + " was passed");
    }

    valObjectInspector = arguments[0];
    bloomFilterObjectInspector = arguments[1];
    assert bloomFilterObjectInspector instanceof WritableBinaryObjectInspector;

    initializedBloomFilter = false;
    return PrimitiveObjectInspectorFactory.javaBooleanObjectInspector;
  }
GenericUDF to lookup a value in BloomFilter
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInBloomFilter.java