Skip to content

Commit 1c4790d

Browse files
committed
add record
1 parent 1de9ee1 commit 1c4790d

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

tinybird/datasources/mailgun.datasource

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,9 @@ TOKEN "append" APPEND
55
TAGS "mailgun"
66

77
SCHEMA >
8-
`date` DateTime `json:$.record.event-data.timestamp` DEFAULT now(),
9-
`event` LowCardinality(String) `json:$.record.event-data.event` DEFAULT '',
10-
`message_id` String `json:$.record.event-data.message.headers.message-id` DEFAULT '',
11-
`recipient` String `json:$.record.event-data.recipient` DEFAULT '',
12-
`recipient_domain` String `json:$.record.event-data.recipient-domain` DEFAULT '',
13-
`tags` Array(String) `json:$.record.event-data.tags[:]` DEFAULT [],
14-
`log_level` LowCardinality(String) `json:$.record.event-data.log-level` DEFAULT '',
15-
`city` String `json:$.record.event-data.geolocation.city` DEFAULT '',
16-
`country` String `json:$.record.event-data.geolocation.country` DEFAULT '',
17-
`region` String `json:$.record.event-data.geolocation.region` DEFAULT '',
18-
`client_info` JSON `json:$.record.event-data.client-info` DEFAULT '{}',
19-
`delivery_status` JSON `json:$.record.event-data.delivery-status` DEFAULT '{}',
20-
`envelope` JSON `json:$.record.event-data.envelope` DEFAULT '{}',
21-
`user_variables` JSON `json:$.record.event-data.user-variables` DEFAULT '{}'
8+
`date` DateTime `json:$.timestamp` DEFAULT now(),
9+
`record` JSON `json:$` DEFAULT '{}'
2210

2311
ENGINE "MergeTree"
2412
ENGINE_PARTITION_KEY "toYYYYMM(date)"
25-
ENGINE_SORTING_KEY "event, date"
13+
ENGINE_SORTING_KEY "date"

0 commit comments

Comments
 (0)