private String deriveAlias( final SqlNode node, Collection<String> aliases, final int ordinal) { String alias = validator.deriveAlias(node, ordinal); if ((alias == null) || aliases.contains(alias)) { String aliasBase = (alias == null) ? "EXPR$" : alias; for (int j = 0;; j++) { alias = aliasBase + j; if (!aliases.contains(alias)) { break; } } } aliases.add(alias); return alias; }
cluster.traitSetOf(Convention.NONE), input, validator.deriveAlias(call, i)); joinList.add(collectRel);
/** * Creates an AggConverter. * * <p>The <code>select</code> parameter provides enough context to name * aggregate calls which are top-level select list items. * * @param bb Blackboard * @param select Query being translated; provides context to give */ public AggConverter(Blackboard bb, SqlSelect select) { this.bb = bb; // Collect all expressions used in the select list so that aggregate // calls can be named correctly. final SqlNodeList selectList = select.getSelectList(); for (int i = 0; i < selectList.size(); i++) { SqlNode selectItem = selectList.get(i); String name = null; if (SqlUtil.isCallTo( selectItem, SqlStdOperatorTable.AS)) { final SqlCall call = (SqlCall) selectItem; selectItem = call.operand(0); name = call.operand(1).toString(); } if (name == null) { name = validator.deriveAlias(selectItem, i); } nameMap.put(selectItem.toString(), name); } }
Pair.of( tmpBb.convertExpression(operand.e), validator.deriveAlias(operand.e, operand.i)));
selectNames.add( k < sysFieldCount ? validator.deriveAlias(expr, k++) : names.get(k++ - sysFieldCount)); selectNames.add(validator.deriveAlias(expr, k++));
private String deriveAlias( final SqlNode node, Collection<String> aliases, final int ordinal) { String alias = validator.deriveAlias(node, ordinal); if ((alias == null) || aliases.contains(alias)) { String aliasBase = (alias == null) ? "EXPR$" : alias; for (int j = 0;; j++) { alias = aliasBase + j; if (!aliases.contains(alias)) { break; } } } aliases.add(alias); return alias; }
private String deriveAlias( final SqlNode node, Collection<String> aliases, final int ordinal) { String alias = validator.deriveAlias(node, ordinal); if ((alias == null) || aliases.contains(alias)) { String aliasBase = (alias == null) ? "EXPR$" : alias; for (int j = 0;; j++) { alias = aliasBase + j; if (!aliases.contains(alias)) { break; } } } aliases.add(alias); return alias; }
(null != bb.root) ? bb.root : new OneRowRel(cluster), Collections.singletonList(bb.convertExpression(node)), Collections.singletonList(validator.deriveAlias(node, 0)), true);
cluster, input, validator.deriveAlias(call, i)); joinList.add(collectRel);
cluster.traitSetOf(Convention.NONE), input, validator.deriveAlias(call, i)); joinList.add(collectRel);
name = validator.deriveAlias(selectItem, i);
Pair.of( tmpBb.convertExpression(operand.e), validator.deriveAlias(operand.e, operand.i)));
Pair.of( tmpBb.convertExpression(operand.e), validator.deriveAlias(operand.e, operand.i)));
/** * Creates an AggConverter. * * <p>The <code>select</code> parameter provides enough context to name * aggregate calls which are top-level select list items. * * @param bb Blackboard * @param select Query being translated; provides context to give */ public AggConverter(Blackboard bb, SqlSelect select) { this.bb = bb; // Collect all expressions used in the select list so that aggregate // calls can be named correctly. final SqlNodeList selectList = select.getSelectList(); for (int i = 0; i < selectList.size(); i++) { SqlNode selectItem = selectList.get(i); String name = null; if (SqlUtil.isCallTo( selectItem, SqlStdOperatorTable.AS)) { final SqlCall call = (SqlCall) selectItem; selectItem = call.operand(0); name = call.operand(1).toString(); } if (name == null) { name = validator.deriveAlias(selectItem, i); } nameMap.put(selectItem.toString(), name); } }
selectNames.add( k < sysFieldCount ? validator.deriveAlias(expr, k++) : names.get(k++ - sysFieldCount)); selectNames.add(validator.deriveAlias(expr, k++));
selectNames.add( k < sysFieldCount ? validator.deriveAlias(expr, k++) : names.get(k++ - sysFieldCount)); selectNames.add(validator.deriveAlias(expr, k++));
(null != bb.root) ? bb.root : new OneRowRel(cluster), Collections.singletonList(bb.convertExpression(call)), Collections.singletonList(validator.deriveAlias(call, 0)), true);
(null != bb.root) ? bb.root : new OneRowRel(cluster), Collections.singletonList(bb.convertExpression(node)), Collections.singletonList(validator.deriveAlias(node, 0)), true);