Name: snowflake
Owner: sensorbee
Description: snowflake ID generation UDS&UDF for SensorBee
Created: 2016-03-08 00:29:07.0
Updated: 2016-03-21 05:33:10.0
Pushed: 2016-03-15 04:20:34.0
Homepage: null
Size: 10
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This UDF generates IDs using Snowflake algorithm proposed by Twitter. The ID is a 63 bit integer consisting of:
Just import plugin package from an application:
rt (
_ "pfi/sensorbee/snowflake/plugin"
Or, register the user defined state and UDF manually to bql package.
reate a user defined state for snowflake UDF.
TE STATE event_id_seq TYPE snowflake_id WITH machine_id=1
ssign IDs to an event sequence. IDs will be generated based on
he state 'event_id_seq'
TE STREAM events_with_id AS SELECT snowflake_id('event_id_seq'), * FROM events;