Build a UDF to execute a custom Addressing operation on an address, based on the provided configuration options.
Build a UDF to execute a custom Addressing operation on an address, based on the provided configuration options.
This UDF has a single argument that is a map of String to Column. The String keys are the address fields that are
to be populated in the RequestAddress, and the column is the value to populate the fields with.
This example uses the returned UDF as "customUdf" and adds an "addressing_result" column to the DataFrame
val resultDataFrame = inputDataFrame.withColumn("addressing_result", customUdf(map( lit("addressNumber"), col("addressNum"), lit("street"), col("street"), lit("city"), col("city"), lit("admin1"), col("state"), lit("postalCode"), col("zip"), lit("country"), col("country")) ))
A UDF that executes a custom Addressing operation.
Build a UDF to geocode an address, based on the provided configuration options.
Build a UDF to geocode an address, based on the provided configuration options. This UDF has a single argument
that is a map of String to Column. The String keys are the address fields that are to be populated in the
RequestAddress, and the column is the value to populate the fields with.
This example uses the returned UDF as "addressingUdf" and adds an "addressing_result" column to the DataFrame:
val resultDataFrame = inputDataFrame.withColumn("addressing_result", addressingUdf(map( lit("addressNumber"), col("addressNum"), lit("street"), col("street"), lit("city"), col("city"), lit("admin1"), col("state"), lit("postalCode"), col("zip"), lit("country"), col("country")) ))
A UDF that executes the geocode operation of the Addressing API.
Build a UDF to lookup a geocoded candidates when given a unique key, based on the provided configuration options.
Build a UDF to lookup a geocoded candidates when given a unique key, based on the provided configuration options. This UDF takes two arguments,
lookupType Key type- it can be GNAF_PID or PBKEY, Key to search and country.
This example uses the returned UDF as "addressingUdf" and adds an "addressing_result" column to the DataFrame:
val resultDataFrame = inputDataFrame.withColumn("addressing_result", addressingUdf(lit("PB_KEY"), col("key"), lit("USA") ))
A UDF that provides a Key Lookup operation.
Build a UDF to reverse geocode a location, based on the provided configuration options.
Build a UDF to reverse geocode a location, based on the provided configuration options. This UDF takes X and Y
coordinates of location to reverse geocode with optional country parameter.
This example uses the returned UDF as "addressingUdf" and adds an "addressing_result" column to the DataFrame:
val resultDataFrame = inputDataFrame.withColumn("addressing_result", addressingUdf( col("x"), col("y"), col("country")) )
A UDF that executes the reverse geocode operation of the Addressing API.
Build a UDF to verify an address, based on the provided configuration options.
Build a UDF to verify an address, based on the provided configuration options. This UDF has a single argument
that is a map of String to Column. The String keys are the address fields that are to be populated in the
RequestAddress, and the column is the value to populate the fields with.
This example uses the returned UDF as "addressingUdf" and adds an "addressing_result" column to the DataFrame:
val resultDataFrame = inputDataFrame.withColumn("addressing_result", addressingUdf(map( lit("addressNumber"), col("addressNum"), lit("street"), col("street"), lit("city"), col("city"), lit("admin1"), col("state"), lit("postalCode"), col("zip"), lit("country"), col("country")) ))
A UDF that provides a verify operation.
Adds an output field for errors.
Adds an output field for errors. Exceptions during processing of a record are caught and then the message is placed in this output field.
The name for the field in the output that any error message is placed.
Changes the output of the UDF from a single row of output fields, taken from the top candidate, to an array of rows of output fields, one for each result in the response.
Changes the output of the UDF from a single row of output fields, taken from the top candidate, to an array of rows of output fields, one for each result in the response. Note: In order to get back multiple results, preferences must be set to allow that.
Adds output fields for the UDF.
Adds output fields for the UDF. Allows you to access any part of the Addressing API Result class. You can use
a simple object notation to access sub objects:
Accessing properties:
The object notation access field names, which will also be the UDF output field names.
Sets the preferences that will be used for all geocode calls.
Sets the preferences that will be used for all geocode calls.
A preferences instance.
Sets the location of a yaml configuration file with the desired preferences.
Sets the location of a yaml configuration file with the desired preferences. Any specific preferences set in this yaml will override the preferences provided by withPreferences
The location of a yaml configuration file.
Adds an output field for Json response.
Adds an output field for Json response. Exceptions during processing of a record are caught and then the message is placed in the error field.
The name for the field in the output where that json Response is placed.
This class allows you to build a UDF that executes an addressing operation. You can obtain an instance of this builder by starting with an AddressingBuilder.