queryparser-0.1.0.1: Analysis and parsing library for SQL queries.

Database.Sql.Util.Lineage.ColumnPlus

Synopsis

# Documentation

ColumnLineagePlus is a set of descendants, each with an associated set of ancestors. Descendents may be a column (representing values in that column) or a table (representing row-count).

Ancestors are the same, but that ancestor columns may be further specialized by field path.

Tracking impacts on row-count is necessary because row-count can have impacts on data without any columns being involved. For a clear example, consider CREATE TABLE foo AS SELECT COUNT(1) FROM BAR;

It also gives us something coherent to speak about with respect to EXISTS - the value depends on the row count of the subquery.

N.b. While it looks like we're talking about "tables", this is *not* the same thing as table-level lineage. Changes to values in existing rows does not impact row count. Following an UPDATE, if we ask "has this table changed, such that we need to rerun things downstream?", the answer is clearly yes. If we ask "has the row-count of this table changed, such that we need to rerun things that depend only on row-count?" the answer is clearly not.

class HasColumnLineage q where Source #

Minimal complete definition

getColumnLineage

Methods

Instances

 Source # Methods

Constructors

 ColumnPlusSet FieldscolumnPlusColumns :: Map FQCN (Map FieldChain (Set Range)) columnPlusTables :: Map FQTN (Set Range)

Instances

 Source # Methods Source # MethodsshowList :: [ColumnPlusSet] -> ShowS # Source # Methodsstimes :: Integral b => b -> ColumnPlusSet -> ColumnPlusSet # Source # Methods