sensorbee/snowflake

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Snowflake UDF for SensorBee

This UDF generates IDs using Snowflake algorithm proposed by Twitter. The ID is a 63 bit integer consisting of:

Usage

Registering plugin

Just import plugin package from an application:

rt (
_ "pfi/sensorbee/snowflake/plugin"

Or, register the user defined state and UDF manually to bql package.

Using UDF from BQL
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;

TODO


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.