Class: AWSCDK::KinesisFirehose::OpenXJsonInputFormatProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
kinesis_firehose/open_x_json_input_format_props.rb

Overview

Props for OpenX JSON input format for data record format conversion.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(column_to_json_key_mappings: nil, convert_dots_in_json_keys_to_underscores: nil, lowercase_column_names: nil) ⇒ OpenXJsonInputFormatProps

Returns a new instance of OpenXJsonInputFormatProps.

Parameters:

  • column_to_json_key_mappings (Hash{String => String}, nil) (defaults to: nil)

    Maps column names to JSON keys that aren't identical to the column names.

  • convert_dots_in_json_keys_to_underscores (Boolean, nil) (defaults to: nil)

    When set to true, specifies that the names of the keys include dots and that you want Firehose to replace them with underscores.

  • lowercase_column_names (Boolean, nil) (defaults to: nil)

    Whether the JSON keys should be lowercased when written as column names.



10
11
12
13
14
15
16
17
# File 'kinesis_firehose/open_x_json_input_format_props.rb', line 10

def initialize(column_to_json_key_mappings: nil, convert_dots_in_json_keys_to_underscores: nil, lowercase_column_names: nil)
  @column_to_json_key_mappings = column_to_json_key_mappings
  Jsii::Type.check_type(@column_to_json_key_mappings, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "columnToJsonKeyMappings") unless @column_to_json_key_mappings.nil?
  @convert_dots_in_json_keys_to_underscores = convert_dots_in_json_keys_to_underscores
  Jsii::Type.check_type(@convert_dots_in_json_keys_to_underscores, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "convertDotsInJsonKeysToUnderscores") unless @convert_dots_in_json_keys_to_underscores.nil?
  @lowercase_column_names = lowercase_column_names
  Jsii::Type.check_type(@lowercase_column_names, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "lowercaseColumnNames") unless @lowercase_column_names.nil?
end

Instance Attribute Details

#column_to_json_key_mappingsHash{String => String}? (readonly)

Note:

Default: JSON keys are not renamed

Maps column names to JSON keys that aren't identical to the column names.

This is useful when the JSON contains keys that are Hive keywords. For example, timestamp is a Hive keyword. If you have a JSON key named timestamp, set this parameter to {"ts": "timestamp"} to map this key to a column named ts

Returns:

  • (Hash{String => String}, nil)


26
27
28
# File 'kinesis_firehose/open_x_json_input_format_props.rb', line 26

def column_to_json_key_mappings
  @column_to_json_key_mappings
end

#convert_dots_in_json_keys_to_underscoresBoolean? (readonly)

Note:

Default: false

When set to true, specifies that the names of the keys include dots and that you want Firehose to replace them with underscores.

This is useful because Apache Hive does not allow dots in column names. For example, if the JSON contains a key whose name is "a.b", you can define the column name to be "a_b" when using this option.

Returns:

  • (Boolean, nil)


34
35
36
# File 'kinesis_firehose/open_x_json_input_format_props.rb', line 34

def convert_dots_in_json_keys_to_underscores
  @convert_dots_in_json_keys_to_underscores
end

#lowercase_column_namesBoolean? (readonly)

Note:

Default: true

Whether the JSON keys should be lowercased when written as column names.

Returns:

  • (Boolean, nil)


39
40
41
# File 'kinesis_firehose/open_x_json_input_format_props.rb', line 39

def lowercase_column_names
  @lowercase_column_names
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
# File 'kinesis_firehose/open_x_json_input_format_props.rb', line 41

def self.jsii_properties
  {
    :column_to_json_key_mappings => "columnToJsonKeyMappings",
    :convert_dots_in_json_keys_to_underscores => "convertDotsInJsonKeysToUnderscores",
    :lowercase_column_names => "lowercaseColumnNames",
  }
end

Instance Method Details

#to_jsiiObject



49
50
51
52
53
54
55
56
57
# File 'kinesis_firehose/open_x_json_input_format_props.rb', line 49

def to_jsii
  result = {}
  result.merge!({
    "columnToJsonKeyMappings" => @column_to_json_key_mappings,
    "convertDotsInJsonKeysToUnderscores" => @convert_dots_in_json_keys_to_underscores,
    "lowercaseColumnNames" => @lowercase_column_names,
  })
  result.compact
end