krapsh-0.1.6.1: Haskell bindings for Spark Dataframes and Datasets

Safe HaskellNone
LanguageHaskell2010

Spark.Core.Internal.Utilities

Description

A collection of small utility functions.

Synopsis

Documentation

type HasCallStack = ?callStack :: CallStack #

Request a CallStack.

NOTE: The implicit parameter ?callStack :: CallStack is an implementation detail and should not be considered part of the CallStack API, we may decide to change the implementation in the future.

Since: 4.9.0.0

data UnknownType Source #

A type that is is not known and that is not meant to be exposed to the user.

pretty :: Value -> Text Source #

Pretty printing for Aeson values (and deterministic output)

myGroupBy :: Ord a => [(a, b)] -> Map a [b] Source #

group by

myGroupBy' :: Ord b => (a -> b) -> [a] -> [(b, [a])] Source #

group by

class CanRename a txt where Source #

The class of types that can be renamed. It is made generic because it covers 2 notions: - the name of a compute node that will eventually determine its compute path - the name of field (which may become an object path) This syntax tries to be convenient and will fail immediately for basic errors such as illegal characters.

This could be revisited in the future, but it is a compromise on readability.

Minimal complete definition

(@@)

Methods

(@@) :: a -> txt -> a infixl 1 Source #

Instances

CanRename (ComputeNode loc a) String Source # 

Methods

(@@) :: ComputeNode loc a -> String -> ComputeNode loc a Source #

missing :: HasCallStack => Text -> a Source #

Missing implementations in the code base.

failure :: HasCallStack => Text -> a Source #

The function that is used to trigger exception due to internal programming errors.

Currently, all programming errors simply trigger an exception. All these impure functions are tagged with an implicit call stack argument.

failure' :: HasCallStack => Format Text (a -> Text) -> a -> c Source #

forceRight :: (HasCallStack, Show a) => Either a b -> b Source #

Given a DataFrame or a LocalFrame, attempts to get the value, or throws the error.

This function is not total.

show' :: Show a => a -> Text Source #

show with Text

encodeDeterministicPretty :: Value -> ByteString Source #

Produces a bytestring output of a JSON value that is deterministic and that is invariant to the insertion order of the keys. (i.e the keys are stored in alphabetic order) This is to ensure that all id computations are stable and reproducible on the server part. TODO(kps) use everywhere JSON is converted

strictList :: Show a => [a] -> [a] Source #

Force the complete evaluation of a list to WNF.

traceHint :: Show a => Text -> a -> a Source #

(internal) prints a hint with a value

sh :: Show a => Format r (a -> r) #

Output a showable value (instance of Show) by turning it into Text.

(<&>) :: Functor f => f a -> (a -> b) -> f b Source #

(<>) :: Monoid m => m -> m -> m infixr 6 #

An infix synonym for mappend.

Since: 4.5.0.0