$ vi ods_mac_track.yaml
DATABASE: bigdataDB
USER: gpadmin
HOST: host106
PORT: 5432
KAFKA:
INPUT:
SOURCE:
BROKERS: host106:9092,host107:9092,host108:9092
TOPIC: mac_data
COLUMNS:
- NAME: jdata
TYPE: json
FORMAT: json
ERROR_LIMIT: 1000
OUTPUT:
TABLE: ods_mac_track
MAPPING:
- NAME: track_id
EXPRESSION: (jdata->>'track_id')::text
- NAME: mac
EXPRESSION: (jdata->>'mac')::text
- NAME: source
EXPRESSION: (jdata->>'source')::int4
- NAME: service_code
EXPRESSION: (jdata->>'service_code')::text
- NAME: geo_point
EXPRESSION: (jdata->>'geo_point')::point
- NAME: geo_hash7
EXPRESSION: (jdata->>'geo_hash7')::text
- NAME: geo_md5
EXPRESSION: (jdata->>'geo_md5')::text
- NAME: start_time
EXPRESSION: (jdata->>'start_time')::timestamp
- NAME: end_time
EXPRESSION: (jdata->>'end_time')::timestamp
- NAME: phone
EXPRESSION: (jdata->>'phone')::text
- NAME: stay_time
EXPRESSION: (jdata->>'stay_time')::int8
COMMIT:
MAX_ROW: 10000