-
Notifications
You must be signed in to change notification settings - Fork 6
Timestamp system column #2048
Description
Amp currently supports _block_num as a system column. It is present in all currently supported raw datasets and is automatically propagated to derived datasets. It's value can be accessed in streaming contexts through the block_num() UDF.
The proposal is to add _ts also as a system column, and a ts() function analogous to the block_num() function. For our blockchain raw datasets this would be the block timestamp.
Compatibility with existing datasets:
It would be expensive to resync raw datasets just to add a physical _ts column, when they already contain the data in the timestamp column. We could add DF schema adapter such that if a table contains timestamp but no _ts, we use the data in timestamp. Over time this hack would become obsolete as datasets are resynced or versioned for other reasons.