Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 

Key

FIRST_NAME

LAST_NAME

addr

CITY

joltie

Nitin

Motgi

150 Grant Ave, Suite A

Palo Alto

 

Conditions

 

  • In case a field is value is not present then it’s considered as NULL. For Example,
    • If Key Field in the input record is NULL, then that particular row will not be considered.
    • If Field Name and Field Value is not present, then denormalized output will have NULL for that field.
    • If user provides output field which is not present in the input record, then it will be considered as NULL.
  • Input record will always have 3 fields and all these fields will be of type String.

Options

  • User is able to specify the Key Field based on the Input Schema (has to be field in Input Schema). This the key of the output row. From the above example it’s “Key Field”

  • User is able to specify the list of fields that should be considered to form a denormalized record. From the above example it should be ‘FIRST_NAME’, ‘LAST_NAME’, ‘ADDRESS’ & ‘CITY’

  • Users are able to specify the output field name for each through mapping. From the above example ‘ADDRESS’ in input is mapped to ‘addr’ in output schema.

  • Similarly simple type conversions should be attempted - {int, long, float, double} -> string

Design

...

Assumptions:

Since input record will be of Schema.Type = String, hence output schema will also be of type String.

Examples

Properties:.

  • keyField: key on the basis of which input record will be denormalized. This field should be included in input schema.
  • fieldNameName of the field in input record that contains output fields to be included in denormalized output.
  • fieldValueName of the field in input record that contains values for output fields to be included in denormalized output.
  • outputFieldsList of the output fields to be included in denormalized output.
  • fieldAliases: List of the output fields to rename. The key specifies the name of the field to rename, with its corresponding value specifying the new name for that field.

...