/** * @param compareType the comparison type, see constants in * {@link Comparison} */ private IndexCondition(int compareType, ExpressionColumn column, Expression expression) { this.compareType = compareType; this.column = column == null ? null : column.getColumn(); this.expression = expression; }
ExpressionColumn expCol = (ExpressionColumn)expression; return new GridSqlColumn(expCol.getColumn(), parseTableFilter(expCol.getTableFilter()), SCHEMA_NAME.get(expCol),
private Index getMinMaxColumnIndex() { if (on instanceof ExpressionColumn) { ExpressionColumn col = (ExpressionColumn) on; Column column = col.getColumn(); TableFilter filter = col.getTableFilter(); if (filter != null) { Table table = filter.getTable(); return table.getIndexForColumn(column, true, false); } } return null; }
/** * Get the column for the given table filter, if the sort column is for this * filter. * * @param index the column index (0, 1,..) * @param filter the table filter * @return the column, or null */ public Column getColumn(int index, TableFilter filter) { if (orderList == null) { return null; } SelectOrderBy order = orderList.get(index); Expression expr = order.expression; if (expr == null) { return null; } expr = expr.getNonAliasExpression(); if (expr.isConstant()) { return null; } if (!(expr instanceof ExpressionColumn)) { return null; } ExpressionColumn exprCol = (ExpressionColumn) expr; if (exprCol.getTableFilter() != filter) { return null; } return exprCol.getColumn(); }
for (int j = 0; j < indexColumns.length; ++j) { if (tableFilter == exprCol.getTableFilter()) { if (indexColumns[j].equals(exprCol.getColumn())) { grouped[j] = true; continue outerLoop;
if (on instanceof ExpressionColumn) { ExpressionColumn col = (ExpressionColumn) on; Column column = col.getColumn(); TableFilter filter = col.getTableFilter(); if (filter != null) {
/** * @param qry Query. * @param expCol Expression column. * @param validate Query validation flag. * @return {@code true} It it is an affinity column. */ private static boolean isAffinityColumn(Query qry, ExpressionColumn expCol, boolean validate) { if (qry.isUnion()) { SelectUnion union = (SelectUnion)qry; return isAffinityColumn(union.getLeft(), expCol, validate) && isAffinityColumn(union.getRight(), expCol, validate); } Expression exp = qry.getExpressions().get(expCol.getColumn().getColumnId()).getNonAliasExpression(); if (exp instanceof ExpressionColumn) { expCol = (ExpressionColumn)exp; return isAffinityColumn(expCol.getTableFilter(), expCol, validate); } return false; }
.setColumn(((ExpressionColumn) left).getColumn());
int dataType = l.getColumn().getType(); if (dataType != Value.STRING && dataType != Value.STRING_IGNORECASE && dataType != Value.STRING_FIXED) {
return null; sortColumns.add(exprCol.getColumn());
"Unable to resolve enumerators of expression"); enumerators = ((ExpressionColumn)expr).getColumn().getEnumerators();
expr = expr.getNonAliasExpression(); if (expr instanceof ExpressionColumn) { Column column = ((ExpressionColumn) expr).getColumn(); int selectivity = column.getSelectivity(); Index columnIndex = topTableFilter.getTable().
/** * @param f Table filter. * @param expCol Expression column. * @param validate Query validation flag. * @return {@code true} It it is an affinity column. */ private static boolean isAffinityColumn(TableFilter f, ExpressionColumn expCol, boolean validate) { Column col = expCol.getColumn(); if (col == null) return false; Table t = col.getTable(); if (t.isView()) { Query qry; if (f.getIndex() != null) qry = getSubQuery(f); else qry = GridSqlQueryParser.VIEW_QUERY.get((TableView)t); return isAffinityColumn(qry, expCol, validate); } if (t instanceof GridH2Table) { GridH2Table t0 = (GridH2Table)t; if (validate && t0.isCustomAffinityMapper()) throw customAffinityError((t0).cacheName()); IndexColumn affCol = t0.getAffinityKeyColumn(); return affCol != null && col.getColumnId() == affCol.column.getColumnId(); } return false; }
Expression checkExpression = fromColumn.getColumn() .getCheckConstraint(session, name); if (checkExpression != null) {
int columnId = index.getColumns()[0].getColumnId(); ExpressionColumn expr = (ExpressionColumn) on; if (expr.getColumn().isNullable()) { boolean hasNulls = false; SearchRow row;
public IndexCondition(int compareType, ExpressionColumn column, Expression expression) { this.compareType = compareType; this.column = column == null ? null : column.getColumn(); this.expression = expression; }
/** * @param compareType the comparison type, see constants in * {@link Comparison} */ private IndexCondition(int compareType, ExpressionColumn column, Expression expression) { this.compareType = compareType; this.column = column == null ? null : column.getColumn(); this.expression = expression; }
private Index getColumnIndex(boolean first) { if (on instanceof ExpressionColumn) { ExpressionColumn col = (ExpressionColumn) on; Column column = col.getColumn(); TableFilter filter = col.getTableFilter(); if (filter != null) { Table table = filter.getTable(); Index index = table.getIndexForColumn(column, first); return index; } } return null; }
private Index getColumnIndex() { if (on instanceof ExpressionColumn) { ExpressionColumn col = (ExpressionColumn) on; Column column = col.getColumn(); TableFilter filter = col.getTableFilter(); if (filter != null) { Table table = filter.getTable(); Index index = table.getIndexForColumn(column); return index; } } return null; }