public final class CommonKeyPrefix extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
add(ExprNodeDesc column,
char order,
char nullOrder) |
List<ExprNodeDesc> |
getMappedColumns() |
String |
getMappedNullOrder() |
String |
getMappedOrder() |
boolean |
isEmpty() |
static CommonKeyPrefix |
map(List<ExprNodeDesc> opKeys,
String opOrder,
String opNullOrder,
List<ExprNodeDesc> parentKeys,
Map<String,ExprNodeDesc> parentColExprMap,
String parentOrder,
String parentNullOrder)
General factory method to map two operator keys.
|
static CommonKeyPrefix |
map(List<ExprNodeDesc> opKeys,
String opOrder,
String opNullOrder,
List<ExprNodeDesc> parentKeys,
String parentOrder,
String parentNullOrder) |
static CommonKeyPrefix |
map(TopNKeyDesc topNKeyDesc,
GroupByDesc groupByDesc)
Factory method to map a
TopNKeyOperator's and a
GroupByOperator's keys. |
static CommonKeyPrefix |
map(TopNKeyDesc topNKeyDesc,
ReduceSinkDesc reduceSinkDesc)
Factory method to map a
TopNKeyOperator's and
a ReduceSinkOperator's keys. |
int |
size() |
public static CommonKeyPrefix map(TopNKeyDesc topNKeyDesc, GroupByDesc groupByDesc)
TopNKeyOperator's and a
GroupByOperator's keys.
This method calls the map(List, String, String, List, Map, String, String) method to do the mapping.
Since the GroupByDesc does not contains any ordering information TopNKeyDesc ordering is passed
for both operators.topNKeyDesc - TopNKeyDesc contains TopNKeyOperator keys.groupByDesc - GroupByDesc contains GroupByOperator keys.CommonKeyPrefix object containing common key prefix of the mapped operators.public static CommonKeyPrefix map(TopNKeyDesc topNKeyDesc, ReduceSinkDesc reduceSinkDesc)
TopNKeyOperator's and
a ReduceSinkOperator's keys.
This method calls the map(List, String, String, List, Map, String, String) method to do the mapping.topNKeyDesc - TopNKeyDesc contains TopNKeyOperator keys.reduceSinkDesc - ReduceSinkDesc contains
ReduceSinkOperator keys.CommonKeyPrefix object containing common key prefix of the mapped operators.public static CommonKeyPrefix map(List<ExprNodeDesc> opKeys, String opOrder, String opNullOrder, List<ExprNodeDesc> parentKeys, Map<String,ExprNodeDesc> parentColExprMap, String parentOrder, String parentNullOrder)
parentColExprMap has an entry with the operator key column name
- and that entry value has the same index as the operator key column index.
- and both key columns has the same ordering
- and both key columns has the same null ordering
Ex.: op1: a, b, c, d
op2: a, b, e
result: a, b
opKeys: Column[_col0], Column[_col1], Column[_col2], Column[_col3]
parentKeys: Column[KEY._col0], Column[KEY._col1], Column[KEY._col4]
parentColExprMap: {_col0 -> Column[KEY._col0]}, {_col1 -> Column[KEY._col1]}, {_col4 -> Column[KEY._col4]}
Column ordering and null ordering is given by a string where each character represents a column order/null order.
Ex.: a ASC NULLS FIRST, b DESC NULLS LAST, c ASC NULLS LAST -> order="+-+", null order="azz"
When parentColExprMap is null this method falls back to
map(List, String, String, List, String, String).opKeys - List of ExprNodeDesc. contains the operator's key columnsopOrder - operator's key column ordering in String formatopNullOrder - operator's key column null ordering in String formatparentKeys - List of ExprNodeDesc. contains the parent operator's key columnsparentColExprMap - Map of String -> ExprNodeDesc.
contains parent operator's key column name ExprNodeDesc mappingparentOrder - parent operator's key column ordering in String formatparentNullOrder - parent operator's key column null ordering in String formatCommonKeyPrefix object containing the common key prefix of the mapped operators.public static CommonKeyPrefix map(List<ExprNodeDesc> opKeys, String opOrder, String opNullOrder, List<ExprNodeDesc> parentKeys, String parentOrder, String parentNullOrder)
public void add(ExprNodeDesc column, char order, char nullOrder)
public boolean isEmpty()
public List<ExprNodeDesc> getMappedColumns()
public String getMappedOrder()
public String getMappedNullOrder()
public int size()
Copyright © 2024 The Apache Software Foundation. All rights reserved.