public RelFieldCollation get(int index) { final RexFieldCollation collation = collations.get(index); return new RelFieldCollation( ((RexLocalRef) collation.left).getIndex(), collation.getDirection(), collation.getNullDirection()); }
public RelFieldCollation get(int index) { final RexFieldCollation collation = collations.get(index); return new RelFieldCollation( ((RexLocalRef) collation.left).getIndex(), collation.getDirection(), collation.getNullDirection()); }
private SqlNode toSql(RexProgram program, RexFieldCollation rfc) { SqlNode node = toSql(program, rfc.left); switch (rfc.getDirection()) { case DESCENDING: case STRICTLY_DESCENDING: node = SqlStdOperatorTable.DESC.createCall(POS, node); } if (rfc.getNullDirection() != dialect.defaultNullDirection(rfc.getDirection())) { switch (rfc.getNullDirection()) { case FIRST: node = SqlStdOperatorTable.NULLS_FIRST.createCall(POS, node); break; case LAST: node = SqlStdOperatorTable.NULLS_LAST.createCall(POS, node); break; } } return node; }
private SqlNode toSql(RexProgram program, RexFieldCollation rfc) { SqlNode node = toSql(program, rfc.left); switch (rfc.getDirection()) { case DESCENDING: case STRICTLY_DESCENDING: node = SqlStdOperatorTable.DESC.createCall(POS, node); } if (rfc.getNullDirection() != dialect.defaultNullDirection(rfc.getDirection())) { switch (rfc.getNullDirection()) { case FIRST: node = SqlStdOperatorTable.NULLS_FIRST.createCall(POS, node); break; case LAST: node = SqlStdOperatorTable.NULLS_LAST.createCall(POS, node); break; } } return node; }
lookupOrCreateGroupExpr(fieldCollation.left), fieldCollation.getDirection(), fieldCollation.getNullDirection())) .collect(Collectors.toList()));