Copyright | (c) Soostone Inc 2020 |
---|---|
License | AllRightsReserved |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- dedupByArray :: AsRelation s => [SExp] -> s -> Q (Ref SExp)
- dedupByRowNumber :: (MaybeQuery s, AsRelation s) => Partition -> s -> Q ()
- topSelect :: [Selected SExp] -> [Selected SExp] -> SExp -> Q a -> Q ()
- combineTablesOuter :: DefinedRelation -> [(DefinedRelation, [Ref Relation -> SExp])] -> Q ()
- normalizeExtremes :: DatePart -> Int -> Relation -> (Ref Relation -> SExp) -> [(Ref Relation -> SExp, Ref a)] -> Q [Ref SExp]
- computePercentiles :: Int -> Relation -> SExp -> [SExp] -> Name -> Q (Ref SExp)
- percentileColumns :: Int -> SExp -> [SExp] -> ([Selected SExp], Ref Relation -> SExp)
Documentation
:: AsRelation s | |
=> [SExp] | Group by / uniquness conditions |
-> s | A table like thing |
-> Q (Ref SExp) |
Use BigQuery's ARRAY support to keep only one row per given partition.
dedupByRowNumber :: (MaybeQuery s, AsRelation s) => Partition -> s -> Q () #
Use BigQuery's ROW_NUMBER function to keep only one row per given partition.
:: [Selected SExp] | Partition within this window; i.e. the unique entity |
-> [Selected SExp] | Select the top-by-count among these breakdowns - e.g. "name" of a product |
-> SExp | Numeric expression to determine frequency |
-> Q a | Rest of the query that should contain the FROM and any WHERE clauses |
-> Q () |
Select the values with the highest occurence within partitions.
:: DefinedRelation | |
-> [(DefinedRelation, [Ref Relation -> SExp])] | Table definitions and primary keys each shares with the first table in list |
-> Q () |
TODO. Subtract primary keys from combined fields and explicitly add PK selects.