napkin-1.0.0
Safe HaskellNone
LanguageGHC2021

Napkin.Untyped.Ops.Redshift

Synopsis

Documentation

toChar :: SExp -> Text -> SExp #

Type casts

toDate :: Text -> Text -> SExp #

stddev_samp :: SExp -> SExp #

Aggregate functions

acos :: SExp -> SExp #

Math functions

asin :: SExp -> SExp #

atan :: SExp -> SExp #

cbrt :: SExp -> SExp #

ceil :: SExp -> SExp #

cos :: SExp -> SExp #

cot :: SExp -> SExp #

dexp :: SExp -> SExp #

exp :: SExp -> SExp #

ln :: SExp -> SExp #

log :: SExp -> SExp #

mod :: SExp -> SExp -> SExp #

pi :: SExp #

sin :: SExp -> SExp #

sqrt :: SExp -> SExp #

tan :: SExp -> SExp #

greatest :: [SExp] -> SExp #

Conditionals

least :: [SExp] -> SExp #

nvl :: [SExp] -> SExp #

nvl2 :: SExp -> SExp -> SExp -> SExp #

nullif :: SExp -> SExp -> SExp #

decode :: SExp -> [(SExp, SExp)] -> Maybe SExp -> SExp #

concat :: [SExp] -> SExp #

String ops

chr :: SExp -> SExp #

left :: SExp -> SExp -> SExp #

right :: SExp -> SExp -> SExp #

len :: SExp -> SExp #

lpad :: SExp -> SExp -> Maybe SExp -> SExp #

rpad :: SExp -> SExp -> Maybe SExp -> SExp #

ltrim :: SExp -> SExp -> SExp #

md5 :: SExp -> SExp #

repeat :: SExp -> SExp -> SExp #

replace :: SExp -> SExp -> SExp -> SExp #

rtrim :: SExp -> SExp -> SExp #

strtol :: SExp -> SExp -> SExp #

substring :: SExp -> Int -> Int -> SExp #

addMonths :: SExp -> SExp -> SExp #

Date functions

wCount :: SExp -> WOver -> SExp #

Window functions

wavg :: SExp -> WOver -> SExp #

wsum :: SExp -> WOver -> SExp #

wmin :: SExp -> WOver -> SExp #

wmax :: SExp -> WOver -> SExp #

denseAvg :: SExp -> SExp #

Higher level combinators

percentDiff :: SExp -> SExp -> SExp #

percent difference of a over b with typecast to Double

scope :: SExp -> SExp -> SExp #

scoped :: SExp -> SExp -> SExp #

textInfix :: SExp -> SExp -> SExp #

Is text a contained in text b?

generateSeries :: SExp -> SExp -> SExp -> SExp #

Other functions

dateDiffSafe :: DatePart -> SExp -> SExp -> SExp #

Special Cases

Redshift seems to have a bug where it will overflow when asking day ranges that become too negative, typically due to faulty columns that have bogus dates like "Nov 1 2065" when referring to values that should be around now.

Keep in mind we do not know exactly how the bug occurs; this is a guess based on what we've seen in a one-off edge condition.

nullIfEmpty :: SExp -> SExp #

Replace empty string with NULL