@Override public Object getValue(TblColRef col) { if (this.col.equals(col)) return value; else throw new IllegalArgumentException("unexpected column " + col); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ColumnTupleExpression that = (ColumnTupleExpression) o; return columnRef != null ? columnRef.equals(that.columnRef) : that.columnRef == null; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CompareTupleFilter that = (CompareTupleFilter) o; if (operator != that.operator) return false; if (column != null ? !column.equals(that.column) : that.column != null) return false; if (function != null ? !function.equals(that.function) : that.function != null) return false; if (secondColumn != null ? !secondColumn.equals(that.secondColumn) : that.secondColumn != null) return false; if (conditionValues != null ? !conditionValues.equals(that.conditionValues) : that.conditionValues != null) return false; if (firstCondValue != null ? !firstCondValue.equals(that.firstCondValue) : that.firstCondValue != null) return false; return dynamicVariables != null ? dynamicVariables.equals(that.dynamicVariables) : that.dynamicVariables == null; }
public void validateColRef(TblColRef ref) { TblColRef expected = colRef(ref.getColumnDesc().getZeroBasedIndex()); if (!expected.equals(ref)) throw new IllegalArgumentException(); }
/** * replace filter on timestamp column to null, so that two tuple filter trees can * be compared regardless of the filter condition on timestamp column (In top level where conditions concatenated by ANDs) * @param filter * @return */ @Override public TupleFilter onSerialize(TupleFilter filter) { if (filter == null) return null; //we just need reference equal if (root == filter) { isInTopLevelANDs.put(filter, true); } if (isInTopLevelANDs.containsKey(filter)) { classifyChildrenByMarking(filter); if (filter instanceof CompareTupleFilter) { TblColRef c = ((CompareTupleFilter) filter).getColumn(); if (c != null && c.equals(tsColumn)) { return null; } } } return filter; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PlainParameter that = (PlainParameter) o; if (type != null ? !type.equals(that.type) : that.type != null) return false; if (this.isColumnType()) { if (!that.isColumnType()) return false; if (!this.colRef.equals(that.colRef)) { return false; } } else { if (that.isColumnType()) return false; if (!this.value.equals(that.value)) return false; } return true; } }
public String getDictionaryBuilderClass(TblColRef col) { if (dictionaries == null) return null; for (DictionaryDesc desc : dictionaries) { if (desc.getBuilderClass() != null) { // column that reuses other's dict need not be built, thus should not reach here if (col.equals(desc.getColumnRef())) { return desc.getBuilderClass(); } } } return null; }
/** * A column may reuse dictionary of another column, find the dict column, return same col if there's no reuse column */ public TblColRef getDictionaryReuseColumn(TblColRef col) { if (dictionaries == null) { return col; } for (DictionaryDesc dictDesc : dictionaries) { if (dictDesc.getColumnRef().equals(col) && dictDesc.getResuseColumnRef() != null) { return dictDesc.getResuseColumnRef(); } } return col; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ParameterDesc that = (ParameterDesc) o; if (type != null ? !type.equals(that.type) : that.type != null) return false; ParameterDesc p = this, q = that; for (; p != null && q != null; p = p.nextParameter, q = q.nextParameter) { if (p.isColumnType()) { if (q.isColumnType() == false) return false; if (q.getColRef().equals(p.getColRef()) == false) return false; } else { if (q.isColumnType() == true) return false; if (p.value.equals(q.value) == false) return false; } } return p == null && q == null; }
private boolean isTopNCompatibleSum(FunctionDesc topN, FunctionDesc sum) { if (sum == null) return false; if (!isTopN(topN)) return false; TblColRef topnNumCol = getTopNNumericColumn(topN); if (topnNumCol == null) { if (sum.isCount()) return true; return false; } if (sum.isSum() == false) return false; if (sum.getParameter() == null || sum.getParameter().getColRefs() == null || sum.getParameter().getColRefs().size() == 0) return false; TblColRef sumCol = sum.getParameter().getColRefs().get(0); return sumCol.equals(topnNumCol); }
private DimensionRangeInfo tryDeduceRangeFromPartitionCol(CubeSegment seg, TblColRef col) { DataModelDesc model = seg.getModel(); PartitionDesc part = model.getPartitionDesc(); if (!part.isPartitioned()) return null; if (!col.equals(part.getPartitionDateColumnRef())) return null; // deduce the dim range from TSRange TSRange tsRange = seg.getTSRange(); if (tsRange.start.isMin || tsRange.end.isMax) return null; // DimensionRangeInfo cannot express infinite String min = tsRangeToStr(tsRange.start.v, part); String max = tsRangeToStr(tsRange.end.v - 1, part); // note the -1, end side is exclusive return new DimensionRangeInfo(min, max); }
public void andMerge(ColumnRange another) { assert this.column.equals(another.column); if (another.satisfyAll()) { return; } if (this.satisfyAll()) { copy(another.column, another.begin, another.end, another.valueSet); return; } if (this.valueSet != null && another.valueSet != null) { this.valueSet.retainAll(another.valueSet); refreshBeginEndFromEquals(); return; } if (this.valueSet != null) { this.valueSet = filter(this.valueSet, another.begin, another.end); refreshBeginEndFromEquals(); return; } if (another.valueSet != null) { this.valueSet = filter(another.valueSet, this.begin, this.end); refreshBeginEndFromEquals(); return; } this.begin = rangeStartComparator.comparator.max(this.begin, another.begin); this.end = rangeEndComparator.comparator.min(this.end, another.end); this.isBoundryInclusive |= another.isBoundryInclusive; }
@Override public Object getValue(TblColRef col) { if (this.col.equals(col)) return value; else throw new IllegalArgumentException("unexpected column " + col); }
@Override public void validate(CubeDesc cube, ValidateContext context) { DataModelDesc model = cube.getModel(); if (model.getRootFactTable().getTableDesc().getSourceType() != ISourceAware.ID_STREAMING) { return; } if (model.getPartitionDesc() == null || model.getPartitionDesc().getPartitionDateColumn() == null) { context.addResult(ResultLevel.ERROR, "Must define a partition column."); return; } final TblColRef partitionCol = model.getPartitionDesc().getPartitionDateColumnRef(); boolean found = false; for (DimensionDesc dimensionDesc : cube.getDimensions()) { for (TblColRef dimCol : dimensionDesc.getColumnRefs()) { if (dimCol.equals(partitionCol)) { found = true; break; } } } if (found == false) { context.addResult(ResultLevel.ERROR, "Partition column '" + partitionCol + "' isn't in dimension list."); return; } }
public boolean isHierarchyColumn(TblColRef col) { if (hierarchy == null) return false; for (HierarchyDesc hier : hierarchy) { if (hier.getColumnRef().equals(col)) return true; } return false; }
public boolean isHierarchyColumn(TblColRef col) { if (hierarchy == null) return false; for (HierarchyDesc hier : hierarchy) { if (hier.getColumnRef().equals(col)) return true; } return false; }
public int getColumnOffset(TblColRef col) { int offset = RowConstants.ROWKEY_CUBOIDID_LEN; for (TblColRef dimCol : cuboid.getColumns()) { if (col.equals(dimCol)) return offset; offset += colIO.getColumnLength(dimCol); } throw new IllegalArgumentException("Column " + col + " not found on cuboid " + cuboid); }
return Range.all(); if (compareTupleFilter.getColumn().equals(colRef)) { Object firstValue = compareTupleFilter.getFirstValue(); long t;
int uhcReducerBegin = -1; for (int i = 0; i < dictEnd; i++) { if (mapping.getColForReducer(i).equals(aUHC)) { uhcReducerBegin = i; break;
public ConciseSet getBitMap(TblColRef col, int valueId) { if (!col.equals(colA)) return null; // i-th record has value ID i, and last record has value null ConciseSet bitMap = new ConciseSet(); if (valueId < 0 || valueId > getMaxValueId(col)) // null bitMap.add(getRecordCount() - 1); else bitMap.add(valueId); return bitMap; }