/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace Firehose { namespace Model { /** *

The OpenX SerDe. Used by Kinesis Data 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.

See Also:

AWS * API Reference

*/ class AWS_FIREHOSE_API OpenXJsonSerDe { public: OpenXJsonSerDe(); OpenXJsonSerDe(Aws::Utils::Json::JsonView jsonValue); OpenXJsonSerDe& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** *

When set to true, specifies that the names of the keys include * dots and that you want Kinesis Data 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.

*/ inline bool GetConvertDotsInJsonKeysToUnderscores() const{ return m_convertDotsInJsonKeysToUnderscores; } /** *

When set to true, specifies that the names of the keys include * dots and that you want Kinesis Data 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.

*/ inline bool ConvertDotsInJsonKeysToUnderscoresHasBeenSet() const { return m_convertDotsInJsonKeysToUnderscoresHasBeenSet; } /** *

When set to true, specifies that the names of the keys include * dots and that you want Kinesis Data 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.

*/ inline void SetConvertDotsInJsonKeysToUnderscores(bool value) { m_convertDotsInJsonKeysToUnderscoresHasBeenSet = true; m_convertDotsInJsonKeysToUnderscores = value; } /** *

When set to true, specifies that the names of the keys include * dots and that you want Kinesis Data 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.

*/ inline OpenXJsonSerDe& WithConvertDotsInJsonKeysToUnderscores(bool value) { SetConvertDotsInJsonKeysToUnderscores(value); return *this;} /** *

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

*/ inline bool GetCaseInsensitive() const{ return m_caseInsensitive; } /** *

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

*/ inline bool CaseInsensitiveHasBeenSet() const { return m_caseInsensitiveHasBeenSet; } /** *

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

*/ inline void SetCaseInsensitive(bool value) { m_caseInsensitiveHasBeenSet = true; m_caseInsensitive = value; } /** *

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

*/ inline OpenXJsonSerDe& WithCaseInsensitive(bool value) { SetCaseInsensitive(value); return *this;} /** *

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.

*/ inline const Aws::Map& GetColumnToJsonKeyMappings() const{ return m_columnToJsonKeyMappings; } /** *

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.

*/ inline bool ColumnToJsonKeyMappingsHasBeenSet() const { return m_columnToJsonKeyMappingsHasBeenSet; } /** *

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.

*/ inline void SetColumnToJsonKeyMappings(const Aws::Map& value) { m_columnToJsonKeyMappingsHasBeenSet = true; m_columnToJsonKeyMappings = value; } /** *

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.

*/ inline void SetColumnToJsonKeyMappings(Aws::Map&& value) { m_columnToJsonKeyMappingsHasBeenSet = true; m_columnToJsonKeyMappings = std::move(value); } /** *

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.

*/ inline OpenXJsonSerDe& WithColumnToJsonKeyMappings(const Aws::Map& value) { SetColumnToJsonKeyMappings(value); return *this;} /** *

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.

*/ inline OpenXJsonSerDe& WithColumnToJsonKeyMappings(Aws::Map&& value) { SetColumnToJsonKeyMappings(std::move(value)); return *this;} /** *

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.

*/ inline OpenXJsonSerDe& AddColumnToJsonKeyMappings(const Aws::String& key, const Aws::String& value) { m_columnToJsonKeyMappingsHasBeenSet = true; m_columnToJsonKeyMappings.emplace(key, value); return *this; } /** *

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.

*/ inline OpenXJsonSerDe& AddColumnToJsonKeyMappings(Aws::String&& key, const Aws::String& value) { m_columnToJsonKeyMappingsHasBeenSet = true; m_columnToJsonKeyMappings.emplace(std::move(key), value); return *this; } /** *

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.

*/ inline OpenXJsonSerDe& AddColumnToJsonKeyMappings(const Aws::String& key, Aws::String&& value) { m_columnToJsonKeyMappingsHasBeenSet = true; m_columnToJsonKeyMappings.emplace(key, std::move(value)); return *this; } /** *

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.

*/ inline OpenXJsonSerDe& AddColumnToJsonKeyMappings(Aws::String&& key, Aws::String&& value) { m_columnToJsonKeyMappingsHasBeenSet = true; m_columnToJsonKeyMappings.emplace(std::move(key), std::move(value)); return *this; } /** *

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.

*/ inline OpenXJsonSerDe& AddColumnToJsonKeyMappings(const char* key, Aws::String&& value) { m_columnToJsonKeyMappingsHasBeenSet = true; m_columnToJsonKeyMappings.emplace(key, std::move(value)); return *this; } /** *

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.

*/ inline OpenXJsonSerDe& AddColumnToJsonKeyMappings(Aws::String&& key, const char* value) { m_columnToJsonKeyMappingsHasBeenSet = true; m_columnToJsonKeyMappings.emplace(std::move(key), value); return *this; } /** *

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.

*/ inline OpenXJsonSerDe& AddColumnToJsonKeyMappings(const char* key, const char* value) { m_columnToJsonKeyMappingsHasBeenSet = true; m_columnToJsonKeyMappings.emplace(key, value); return *this; } private: bool m_convertDotsInJsonKeysToUnderscores; bool m_convertDotsInJsonKeysToUnderscoresHasBeenSet; bool m_caseInsensitive; bool m_caseInsensitiveHasBeenSet; Aws::Map m_columnToJsonKeyMappings; bool m_columnToJsonKeyMappingsHasBeenSet; }; } // namespace Model } // namespace Firehose } // namespace Aws