Package dev.frostlake.metastore.model
Class JoinedRelations
java.lang.Object
dev.frostlake.metastore.model.JoinedRelations
The relations a join's merged relation is assembled from, and which of them an outer join extends
with NULLs: what the account's planner knows of a joined column's nullability beside its table's
statistics. A relation no outer join extends keeps what its statistics prove — live tags
COALESCE(a.n, 3000.5) over an inner, comma, cross or LEFT join, with a the kept side
and a.n holding no NULL, by a.n's width alone. A relation an outer join extends may
answer NULL whatever its table holds: a LEFT join extends its right side, a RIGHT join every relation
on its left, a FULL join both, and an extended relation stays extended through every later join and
filter.
Relations are compared by identity: the FROM clause gives each alias its own instance.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanWhetherrelationis one of the joined relations.booleanisNullExtended(Table relation) Whether an outer join extendsrelationwith NULLs.static JoinedRelationsThe relations ofleftjoined toright, either of which may itself be an earlier join's merged relation.keptRelationWith(String columnName) The first relation no outer join extends that carriescolumnName: the side a USING or NATURAL key written bare reads, which for a RIGHT join is its right side — live tagsCOALESCE(k, 3000.5)overa RIGHT JOIN b USING (k)byb.k's width alone.
-
Method Details
-
joining
public static JoinedRelations joining(Table left, Table right, boolean leftNullExtended, boolean rightNullExtended) The relations ofleftjoined toright, either of which may itself be an earlier join's merged relation.- Parameters:
left- the join's left inputright- the join's right inputleftNullExtended- whether the join extends its left input with NULLs, as RIGHT and FULL dorightNullExtended- whether the join extends its right input with NULLs, as LEFT and FULL do- Returns:
- the merged relation's record
-
includes
Whetherrelationis one of the joined relations.- Parameters:
relation- a relation of the FROM clause- Returns:
- true when this join assembles it
-
isNullExtended
Whether an outer join extendsrelationwith NULLs.- Parameters:
relation- a relation of the FROM clause- Returns:
- true when some outer join of the chain extends it
-
keptRelationWith
The first relation no outer join extends that carriescolumnName: the side a USING or NATURAL key written bare reads, which for a RIGHT join is its right side — live tagsCOALESCE(k, 3000.5)overa RIGHT JOIN b USING (k)byb.k's width alone.- Parameters:
columnName- the key's name- Returns:
- the kept relation, or null when an outer join extends every relation carrying it
-