Class: AWSCDK::KinesisFirehose::CfnDeliveryStream::OpenXJsonSerDeProperty

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

Overview

The OpenX SerDe.

Used by Firehose for deserializing data, which means converting it from the JSON format in preparation for serializing it to the Parquet or ORC format. This is one of two deserializers you can choose, depending on which one offers the functionality you need. The other option is the native Hive / HCatalog JsonSerDe.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(case_insensitive: nil, column_to_json_key_mappings: nil, convert_dots_in_json_keys_to_underscores: nil) ⇒ OpenXJsonSerDeProperty

Returns a new instance of OpenXJsonSerDeProperty.

Parameters:

  • case_insensitive (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    When set to true , which is the default, Firehose converts JSON keys to lowercase before deserializing them.

  • column_to_json_key_mappings (AWSCDK::IResolvable, 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, AWSCDK::IResolvable, 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.



3372
3373
3374
3375
3376
3377
3378
3379
# File 'kinesis_firehose/cfn_delivery_stream.rb', line 3372

def initialize(case_insensitive: nil, column_to_json_key_mappings: nil, convert_dots_in_json_keys_to_underscores: nil)
  @case_insensitive = case_insensitive
  Jsii::Type.check_type(@case_insensitive, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "caseInsensitive") unless @case_insensitive.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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoic3RyaW5nIn0sImtpbmQiOiJtYXAifX1dfX0=")), "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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "convertDotsInJsonKeysToUnderscores") unless @convert_dots_in_json_keys_to_underscores.nil?
end

Instance Attribute Details

#case_insensitiveBoolean, ... (readonly)

When set to true , which is the default, Firehose converts JSON keys to lowercase before deserializing them.



3385
3386
3387
# File 'kinesis_firehose/cfn_delivery_stream.rb', line 3385

def case_insensitive
  @case_insensitive
end

#column_to_json_key_mappingsAWSCDK::IResolvable, ... (readonly)

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 .



3392
3393
3394
# File 'kinesis_firehose/cfn_delivery_stream.rb', line 3392

def column_to_json_key_mappings
  @column_to_json_key_mappings
end

#convert_dots_in_json_keys_to_underscoresBoolean, ... (readonly)

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.

The default is false .



3401
3402
3403
# File 'kinesis_firehose/cfn_delivery_stream.rb', line 3401

def convert_dots_in_json_keys_to_underscores
  @convert_dots_in_json_keys_to_underscores
end

Class Method Details

.jsii_propertiesObject



3403
3404
3405
3406
3407
3408
3409
# File 'kinesis_firehose/cfn_delivery_stream.rb', line 3403

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

Instance Method Details

#to_jsiiObject



3411
3412
3413
3414
3415
3416
3417
3418
3419
# File 'kinesis_firehose/cfn_delivery_stream.rb', line 3411

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