Tabnine Logo
StdUDF.init
Code IndexAdd Tabnine to your IDE (free)

How to use
init
method
in
com.linkedin.transport.api.udf.StdUDF

Best Java code snippets using com.linkedin.transport.api.udf.StdUDF.init (Showing top 9 results out of 315)

origin: com.linkedin.transport/transportable-udfs-hive

@Override
public void copyToNewInstance(Object newInstance) throws UDFArgumentException {
 super.copyToNewInstance(newInstance);
 if (_stdUdf == null) {
  return;
 }
 StdUdfWrapper newWrapper = (StdUdfWrapper) newInstance;
 newWrapper._inputObjectInspectors = _inputObjectInspectors;
 newWrapper._stdFactory = _stdFactory;
 newWrapper._stdUdf = _stdUdf;
 newWrapper._nullableArguments = _stdUdf.getAndCheckNullableArguments();
 newWrapper._stdUdf.init(_stdFactory);
 newWrapper._requiredFilesProcessed = false;
 newWrapper.createStdData();
}
origin: linkedin/transport

@Override
public void copyToNewInstance(Object newInstance) throws UDFArgumentException {
 super.copyToNewInstance(newInstance);
 if (_stdUdf == null) {
  return;
 }
 StdUdfWrapper newWrapper = (StdUdfWrapper) newInstance;
 newWrapper._inputObjectInspectors = _inputObjectInspectors;
 newWrapper._stdFactory = _stdFactory;
 newWrapper._stdUdf = _stdUdf;
 newWrapper._nullableArguments = _stdUdf.getAndCheckNullableArguments();
 newWrapper._stdUdf.init(_stdFactory);
 newWrapper._requiredFilesProcessed = false;
 newWrapper.createStdData();
}
origin: com.linkedin.transport/transportable-udfs-presto

@Override
public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager,
  FunctionRegistry functionRegistry) {
 StdFactory stdFactory = new PrestoFactory(boundVariables, typeManager, functionRegistry);
 StdUDF stdUDF = getStdUDF();
 stdUDF.init(stdFactory);
 // Subtract a small jitter value so that refresh is triggered on first call
 // Do not add extra delay, if refresh time was set to lower value by an earlier specialize
 long initialJitter = getRefreshIntervalMillis() / JITTER_FACTOR;
 int initialJitterInt = initialJitter > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) initialJitter;
 _requiredFilesNextRefreshTime =
   Math.min(_requiredFilesNextRefreshTime, System.currentTimeMillis() - (new Random()).nextInt(initialJitterInt));
 boolean[] nullableArguments = stdUDF.getAndCheckNullableArguments();
 return new ScalarFunctionImplementation(true, getNullConventionForArguments(nullableArguments),
   getMethodHandle(stdUDF, typeManager, boundVariables, nullableArguments), isDeterministic());
}
origin: linkedin/transport

@Override
public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager,
  FunctionRegistry functionRegistry) {
 StdFactory stdFactory = new PrestoFactory(boundVariables, typeManager, functionRegistry);
 StdUDF stdUDF = getStdUDF();
 stdUDF.init(stdFactory);
 // Subtract a small jitter value so that refresh is triggered on first call
 // Do not add extra delay, if refresh time was set to lower value by an earlier specialize
 long initialJitter = getRefreshIntervalMillis() / JITTER_FACTOR;
 int initialJitterInt = initialJitter > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) initialJitter;
 _requiredFilesNextRefreshTime =
   Math.min(_requiredFilesNextRefreshTime, System.currentTimeMillis() - (new Random()).nextInt(initialJitterInt));
 boolean[] nullableArguments = stdUDF.getAndCheckNullableArguments();
 return new ScalarFunctionImplementation(true, getNullConventionForArguments(nullableArguments),
   getMethodHandle(stdUDF, typeManager, boundVariables, nullableArguments), isDeterministic());
}
origin: linkedin/transport

/**
 * Given input {@link TestType}s, this method matches them to the expected {@link TestType}, and finds bindings to the
 * generic parameters. Once the generic parameter bindings are known, the method infers the output type (in the form
 * of a {@link TestType}) by substituting the binding values in the output {@link TestType}.
 *
 * @param arguments Input {@link TestType} of UDF parameters.
 * @return Inferred output {@link TestType}.
 */
public TestType initialize(TestType[] arguments) {
 GenericTypeInference genericTypeInference = new GenericTypeInference();
 genericTypeInference.compile(arguments, getStdUdfImplementations(), getTopLevelUdfClass());
 _inputTypes = genericTypeInference.getInputDataTypes();
 _stdFactory = genericTypeInference.getStdFactory();
 _stdUdf = genericTypeInference.getStdUdf();
 _nullableArguments = _stdUdf.getAndCheckNullableArguments();
 _stdUdf.init(_stdFactory);
 _requiredFilesProcessed = false;
 createStdData();
 return genericTypeInference.getOutputDataType();
}
origin: com.linkedin.transport/transportable-udfs-avro

/**
 * Given input schemas, this method matches them to the expected type signatures, and finds bindings to the
 * generic parameters. Once the generic parameter bindings are known, the method infers the output type (in the form
 * of an Avro schema) by substituting the binding values in the output type signature.
 * signature and
 * @param arguments Input Avro Schemas of UDF parameters.
 * @return Inferred output Avro Schema.
 */
public Schema initialize(Schema[] arguments) {
 AvroTypeInference avroTypeInference = new AvroTypeInference();
 avroTypeInference.compile(arguments, getStdUdfImplementations(), getTopLevelUdfClass());
 _inputSchemas = avroTypeInference.getInputDataTypes();
 _stdFactory = avroTypeInference.getStdFactory();
 _stdUdf = avroTypeInference.getStdUdf();
 _nullableArguments = _stdUdf.getAndCheckNullableArguments();
 _stdUdf.init(_stdFactory);
 _requiredFilesProcessed = false;
 createStdData();
 return avroTypeInference.getOutputDataType();
}
origin: linkedin/transport

/**
 * Given input schemas, this method matches them to the expected type signatures, and finds bindings to the
 * generic parameters. Once the generic parameter bindings are known, the method infers the output type (in the form
 * of an Avro schema) by substituting the binding values in the output type signature.
 * signature and
 * @param arguments Input Avro Schemas of UDF parameters.
 * @return Inferred output Avro Schema.
 */
public Schema initialize(Schema[] arguments) {
 AvroTypeInference avroTypeInference = new AvroTypeInference();
 avroTypeInference.compile(arguments, getStdUdfImplementations(), getTopLevelUdfClass());
 _inputSchemas = avroTypeInference.getInputDataTypes();
 _stdFactory = avroTypeInference.getStdFactory();
 _stdUdf = avroTypeInference.getStdUdf();
 _nullableArguments = _stdUdf.getAndCheckNullableArguments();
 _stdUdf.init(_stdFactory);
 _requiredFilesProcessed = false;
 createStdData();
 return avroTypeInference.getOutputDataType();
}
origin: com.linkedin.transport/transportable-udfs-hive

/**
 * Given input object inspectors, this method matches them to the expected type signatures, and finds bindings to the
 * generic parameters. Once the generic parameter bindings are known, the method infers the output type (in the form
 * of object inspectors) by substituting the binding values in the output type signature.
 * signature and
 * @param arguments Input object inspectors of UDF parameters.
 * @return Inferred output object inspector.
 */
@Override
public ObjectInspector initialize(ObjectInspector[] arguments) {
 HiveTypeInference hiveTypeInference = new HiveTypeInference();
 hiveTypeInference.compile(
   arguments,
   getStdUdfImplementations(),
   getTopLevelUdfClass()
 );
 _inputObjectInspectors = hiveTypeInference.getInputDataTypes();
 _stdFactory = hiveTypeInference.getStdFactory();
 _stdUdf = hiveTypeInference.getStdUdf();
 _nullableArguments = _stdUdf.getAndCheckNullableArguments();
 _stdUdf.init(_stdFactory);
 _requiredFilesProcessed = false;
 createStdData();
 return hiveTypeInference.getOutputDataType();
}
origin: linkedin/transport

/**
 * Given input object inspectors, this method matches them to the expected type signatures, and finds bindings to the
 * generic parameters. Once the generic parameter bindings are known, the method infers the output type (in the form
 * of object inspectors) by substituting the binding values in the output type signature.
 * signature and
 * @param arguments Input object inspectors of UDF parameters.
 * @return Inferred output object inspector.
 */
@Override
public ObjectInspector initialize(ObjectInspector[] arguments) {
 HiveTypeInference hiveTypeInference = new HiveTypeInference();
 hiveTypeInference.compile(
   arguments,
   getStdUdfImplementations(),
   getTopLevelUdfClass()
 );
 _inputObjectInspectors = hiveTypeInference.getInputDataTypes();
 _stdFactory = hiveTypeInference.getStdFactory();
 _stdUdf = hiveTypeInference.getStdUdf();
 _nullableArguments = _stdUdf.getAndCheckNullableArguments();
 _stdUdf.init(_stdFactory);
 _requiredFilesProcessed = false;
 createStdData();
 return hiveTypeInference.getOutputDataType();
}
com.linkedin.transport.api.udfStdUDFinit

Javadoc

Performs necessary initializations for a StdUDF. This method is called before any records are processed by the UDF. All overriding implementations MUST call super.init(stdFactory) at the beginning of this method to ensure the StdFactory object is set. Also any StdUDF instantiating another StdUDF inside it MUST call #init(StdFactory)of contained UDF.

Popular methods of StdUDF

  • getAndCheckNullableArguments
    Returns an array of booleans indicating if any input argument is nullable and also verifies its leng
  • processRequiredFiles
    Processes the localized files for the StdUDF. This method is called before any records are processed
  • getInputParameterSignatures
    Returns a List of type signature strings representing the input parameters to the UDF
  • getOutputParameterSignature
    Returns a type signature string representing the output parameter to the UDF
  • getNullableArguments
    Returns an array of booleans indicating if any input argument is nullable. Nullable arguments are ar
  • getStdFactory
    Returns a StdFactory object which can be used to create StdData and StdType objects
  • numberOfArguments
    Returns the number of input arguments for the StdUDF

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now