manuallatestProduct Manual / TaCustomTableWriter plugin
TaCustomTableWriter plugin
1. Introduction
TACustomTableWriter lets you create custom tables in AE.
In some cases, the data you need may not be representable as users or events, such as mapping tables or external data. To use this data, import it into AE as custom data with the TACustomTableWriter plugin.
2. Features and limitations
Only the custom table feature of AE is supported.
3. Features
3.1 Configuration example
{
"job": {
"setting": {
"speed": {
"channel": 1
}
},
"content": [
{
"reader": {
"name": "streamreader",
"parameter": {
"column": [
{
"value": 123456,
"type": "long"
},
{
"value": "123123",
"type": "string"
},
{
"value": "pay",
"type": "string"
},
{
"value": "2020-01-01 08:08:08",
"type": "date"
},
{
"value": "2020-01-01 08:08:08",
"type": "date"
},
{
"value": "2222",
"type": "string"
},
{
"value": "2020-01-01 08:08:08",
"type": "date"
},
{
"value": "test",
"type": "string"
},
{
"value": true,
"type": "bool"
}
],
"sliceRecordCount": 10
}
},
"writer": {
"name": "ta-custom-table-writer",
"parameter": {
"appid": "6f9e64da5bc74792b9e9c1db4e3e3822",
"table": "ta_custom_table",
"tableDesc": "Test table",
"partitionValue": "2020-01-01",
"writeMode": "overwrite",
"column": [
{
"type": "double",
"name": "id"
},
{
"type": "string",
"name": "distinct_id"
},
{
"type": "string",
"name": "event_name"
},
{
"type": "string",
"name": "time"
},
{
"name": "event_time",
"type": "string"
},
{
"type": "string",
"name": "account_id"
},
{
"type": "string",
"name": "testDate"
},
{
"type": "string",
"name": "timetest2"
},
{
"type": "string",
"name": "os_1"
}
]
}
}
}
]
}
}
3.2 Parameters
-
appid
- Description: The appid of the project that the imported table belongs to. You can find it in the AE backend. The project must exist in the system and must not be offline.
- Type: string
- Required: Yes
- Default: None
-
table
- Description: The name of the table imported into AE. Note: Table names must be globally unique. Add a prefix or suffix that distinguishes different projects. Table names can contain only digits, letters, and underscores.
- Type: string
- Required: Yes
- Default: None
-
tableDesc
- Description: A comment for the imported table. Configure this parameter when you import, so that the meaning of the table is clear when you query it later.
- Type: string
- Required: No
- Default: Empty
-
partitionValue
- Description: The partition value to import into. Custom tables imported into AE always include the partition field $pt, so you must specify a partition value when you import. You can usually set it to the date of the imported data, for example: 20180701. Time macro substitution is also supported, for example: @[{yyyyMMdd}-{1day}]. For details, see Using time macros
- Type: string
- Required: Yes
- Default: None
-
writeMode
-
Description: How TACustomTableWriter cleans up data before writing:
- append: Appends data to the partitionValue partition.
- overwrite: Deletes the existing files in the partitionValue partition, then writes the data from this import.
- Required: Yes
- Default: None
-
-
column
- Description: The fields to write data to
- Required: Yes
- Default: None
- Where name specifies the field name and type specifies the field type.
You can specify Column field information with the following configuration:
"column":
[
{
"name": "userName",
"type": "string"
},
{
"name": "age",
"type": "long"
}
]
3.3 Type conversion
Currently, TACustomTableWriter supports HIVE types. Make sure to check your types.
The following is the list of HIVE data type conversions for TACustomTableWriter:
| DataX internal type | HIVE data type |
|---|---|
| Long | TINYINT,SMALLINT,INT,BIGINT |
| Double | FLOAT,DOUBLE |
| String | STRING,VARCHAR,CHAR |
| Boolean | BOOLEAN |
| Date | DATE,TIMESTAMP |
Was this page helpful?

