EMR Load
    • Dark
      Light

    EMR Load

    • Dark
      Light

    Article Summary

    This article is specific to the following platforms - Redshift.

    EMR Load Component

    Load data into an existing table from objects stored on an EMR cluster.

    Many of the configuration settings on this component have sensible defaults, mirroring the defaults provided by Redshift when that option is not specified. Mandatory settings are:

    1. Target Table Name
    2. Load Columns
    3. EMR URL Location
    4. EMR Object Prefix
    5. Data File Type

    In addition, it is likely you will need to confirm the following settings:

    1. Delimiter
    2. Compression Method
    3. Ignore Header Rows

    Note: This component requires working AWS Credentials with read access to the EMR cluster containing the source data file(s). The is easily achieved by attaching an IAM role to the instance when launching Matillion ETL for Redshift, however it can also be managed manually by editing an Environment.


    Properties

    PropertySettingDescription
    For more information on all the settings in this component, see the Amazon Redshift COPY syntax for more information.
    NameTextA human-readable name for the component.
    SchemaSelectSelect the table schema. The special value, [Environment Default] will use the schema defined in the environment. For more information on using multiple schemas, see this article.
    Target TableSelectSelect an existing table to load data into.
    Load ColumnsSelect MultipleOne or more columns that exist in the target table.
    EMR URL LocationTextThe URL of the EMR source path to get the files from. This follows the format emr://myemrclusterid/location, where location is optional.
    EMR Object PrefixTextAll files that begin with this prefix will be included in the load into the target table.
    IAM Role ARNTextSupply the value of a role ARN that is already attached to your Redshift cluster, and has the necessary permissions to access the EMR cluster. This is optional, since without this style of setup, the credentials of the environment (instance credentials or manually entered access keys) will be used.
    See the Redshift documentation for more information about using a Role ARN with Redshift.
    Data TypeSelectAvailable options are:
    Delimited
    CSV
    Fixed Width - this requires an additional "Fixed Width Spec". See the amazon documentation for details.
    JSON - this requires an additional "JSON Format". See the amazon documentation for details.
    Avro - this requires an additional "Avro Format". See the amazon documentation for details.
    DelimiterTextThe delimiter that separates columns. The default is a Comma. A [TAB] character can be specified as "\ ".
    Fixed Width SpecTextLoads the data from a file where each column width is a fixed length, rather than separated by a delimiter. Each column is described by a name and length, separated by a colon. Each described column is then separated by a comma.
    e.g. We have four columns; name, id, age, state. These columns have the respective lengths; 12,8,2,2.
    The written description to convert this data into a table using fixed-width columns would then be:
    name:12,id:8,age:2,state:2

    Note that the columns can have any plaintext name. For more information on fixed width inputs, please consult the AWS documentation.
    CSV QuoterTextSpecifies the character to be used as the quote character when using the CSV option.
    JSON LayoutTextDefaults to 'auto' which should work for the majority of JSON files if the fields match the table field names. Optionally can specify the URL to a JSONPaths file to map the data elements in the JSON source data to the columns in the target table.
    AVRO LayoutTextDefaults to 'auto' which should work for the majority of Avro files if the fields match the table field names. Optionally can specify the URL to a JSONPaths file to map the data elements in the Avro source data to the columns in the target table.
    Compression MethodSelectWhether the input file is compressed in gzip format, LZOP format, or not compressed at all.
    EncodingSelectThe encoding the data is in. This defaults to UTF-8.
    Remove QuotesSelectWhether to remove any quotes surrounding data values.
    Replace Invalid CharactersTextIf there are any invalid unicode characters in the data, this parameter specified the single character replacement for them. Defaults to '?'.
    Maximum ErrorsTextThe maximum number of individual parsing errors that cause the whole load to fail. Values up to this will be substituted as null values.This value defaults to 0, but the Amazon default is 1000.
    Date FormatTextDefaults to 'auto' - this can be used to manually specify a date format.
    Time FormatTextDefaults to 'auto' - this can be used to manually specify a time format.
    Ignore Header RowsTextThe number of rows at the top of the file to ignore - defaults to 0.
    Accept Any DateSelectIf this is enabled, invalid dates such as '45-65-2018' are not considered an error, but will be loaded as the null value.
    Ignore Blank LinesSelectIf this is set, any blank lines in the input file are ignored.
    Truncate ColumnsSelectIf this is set, any instance of data in the input file that is too long to fit into the specified target column width will be truncated to fit instead of causing an error.
    Fill RecordSelectAllows data files to be loaded when contiguous columns are missing at the end of some of the records. The remaining columns are set to null.
    Trim BlanksSelectRemoves trailing and leading whitespace from the input data.
    Null AsTextThis option replaces the specified string with null in the output table. Use this is your data has a particular representation of missing data.
    Empty As NullSelectIf this is set, empty columns in the input file will become NULL.
    Blanks As NullSelectIf this is set, blank columns in the input file will become NULL.
    Comp UpdateSelectControls whether compression encodings are automatically applied during a COPY. This is usually a good idea to optimise the compression used when storing the data.
    EscapeSelectWhen this option is specified, the backslash character (\\) in input data is treated as an escape character.
    Stat UpdateSelectGoverns automatic computation and refresh of optimizer statistics at the end of a successful COPY command.
    Round DecimalsSelectIf this option is set, round any decimals to fit into the column when the number of decimal places in the input data is larger than defined for the target column.
    Explicit IDsSelectWhether or not to load data from the EMR Objects into an IDENTITY column. See the Redshift documentation for more information.