-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathschema.py
More file actions
29 lines (26 loc) · 769 Bytes
/
schema.py
File metadata and controls
29 lines (26 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from ai.chronon.group_by import GroupBy, Aggregation, Operation
from ai.chronon.source import EventSource
from ai.chronon.query import Query, select
logging_schema_source = EventSource(
table="default.chronon_log_table",
query=Query(
selects=select(
schema_hash="decode(unbase64(key_base64), 'utf-8')",
schema_value="decode(unbase64(value_base64), 'utf-8')"
),
wheres=["name='SCHEMA_PUBLISH_EVENT'"],
time_column="ts_millis",
),
)
v1 = GroupBy(
keys=["schema_hash"],
sources=logging_schema_source,
aggregations=[
Aggregation(
input_column="schema_value",
operation=Operation.LAST
)
],
online=False,
backfill_start_date="2023-04-09"
)