aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
120 lines (119 loc) • 4.61 kB
TypeScript
import type { CfnDeliveryStream } from '../kinesisfirehose.generated';
/**
* An input format to be used in Firehose record format conversion.
*/
export interface IInputFormat {
/**
* Renders the cloudformation properties for the input format.
*/
createInputFormatConfig(): CfnDeliveryStream.InputFormatConfigurationProperty;
}
/**
* Props for OpenX JSON input format for data record format conversion
*/
export interface OpenXJsonInputFormatProps {
/**
* Whether the JSON keys should be lowercased when written as column names
*
* @default `true`
*/
readonly lowercaseColumnNames?: boolean;
/**
* 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`
*
* @default JSON keys are not renamed
*/
readonly columnToJsonKeyMappings?: Record<string, string>;
/**
* 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.
*
* @default `false`
*/
readonly convertDotsInJsonKeysToUnderscores?: boolean;
}
/**
* This class specifies properties for OpenX JSON input format for record format conversion.
*
* You should only need to specify an instance of this class if the default configuration does not suit your needs.
*/
export declare class OpenXJsonInputFormat implements IInputFormat {
/**
* Properties for OpenX JSON input format
*/
readonly props?: OpenXJsonInputFormatProps;
constructor(props?: OpenXJsonInputFormatProps);
private createOpenXJsonSerde;
createInputFormatConfig(): CfnDeliveryStream.InputFormatConfigurationProperty;
}
/**
* Value class that wraps a Joda Time format string.
* Use this with the Hive JSON input format for data record format conversion to parse custom timestamp formats.
*/
export declare class TimestampParser {
/**
* Parses timestamps formatted in milliseconds since epoch.
*/
static readonly EPOCH_MILLIS: TimestampParser;
/**
* Creates a TimestampParser from the given format string.
*
* The format string should be a valid Joda Time pattern string.
* See [Class DateTimeFormat](https://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html) for more details
*
* @param format the Joda Time format string
*/
static fromFormatString(format: string): TimestampParser;
/**
* The format string to use in Hive JSON input format configuration.
*/
readonly format: string;
private constructor();
}
/**
* Props for Hive JSON input format for data record format conversion
*/
export interface HiveJsonInputFormatProps {
/**
* List of TimestampParsers.
*
* These are used to parse custom timestamp strings from input JSON into dates.
*
* Note: Specifying a parser will override the default timestamp parser. If the default timestamp parser is required,
* include `TimestampParser.DEFAULT` in the list of parsers along with the custom parser.
*
* @default the default timestamp parser is used
*/
readonly timestampParsers?: TimestampParser[];
}
/**
* This class specifies properties for Hive JSON input format for record format conversion.
*
* You should only need to specify an instance of this class if the default configuration does not suit your needs.
*/
export declare class HiveJsonInputFormat implements IInputFormat {
/**
* Properties for Hive JSON input format
*/
readonly props?: HiveJsonInputFormatProps;
constructor(props?: HiveJsonInputFormatProps);
private createHiveJsonSerde;
createInputFormatConfig(): CfnDeliveryStream.InputFormatConfigurationProperty;
}
/**
* Represents possible input formats when performing record data conversion.
*/
export declare class InputFormat {
/**
* Parse input JSON with OpenX JSON specification. This will typically suffice.
*/
static readonly OPENX_JSON: OpenXJsonInputFormat;
/**
* Parse input JSON with Hive JSON specification.
*/
static readonly HIVE_JSON: HiveJsonInputFormat;
private constructor();
}