Heka Redshift Helper Functions (no DB connection needed)
1. Functions
1.1. strip_nonprint
A CHAR column can only contain single-byte characters http://docs.aws.amazon.com/redshift/latest/dg/r_Character_types.html this function will replace all non printable characters with a question mark '?'.
Arguments
- v (string) - string to strip
Return
- ss (string) - stripped string
1.2. esc_timestamp
Arguments
- v (number) - timestamp in nano seconds since Jan 1, 1970
- default (string) - value to return if the input is invalid (non-numeric or out of range)
Return
- TIMESTAMP (string)
1.3. esc_smallint
Arguments
- v (number) - small integer
- default (string) - value to return if the input is invalid (non-numeric or out of range)
Return
- SMALLINT (string)
1.4. esc_integer
Arguments
- v (number) - integer
- default (string) - value to return if the input is invalid (non-numeric or out of range)
Return
- INTEGER (string)
1.5. esc_bigint
Arguments
- v (number) - big integer
- default (string) - value to return if the input is invalid (non-numeric or out of range)
Return
- BIGINT (string)
1.6. esc_double
Arguments
- v (number) - double
- default (string) - value to return if the input is invalid (non-numeric or out of range)
Return
- DOUBLE PRECISION (string)
1.7. esc_boolean
Arguments
- v (number) - double
- default (string) - value to return if the input is invalid (non-numeric or out of range)
Return
- BOOLEAN (string)
source code: redshift.lua