Skip to content

Timestamp system column #2048

@leoyvens

Description

@leoyvens

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions