jhugomoore commented on code in PR #3281:
URL: https://github.com/apache/calcite/pull/3281#discussion_r1245535593
##########
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java:
##########
@@ -610,17 +610,10 @@ protected Context(SqlDialect dialect, int fieldCount,
boolean ignoreCast) {
*/
public SqlNode orderField(int ordinal) {
final SqlNode node = field(ordinal);
- if (node instanceof SqlNumericLiteral
- && dialect.getConformance().isSortByOrdinal()) {
- // An integer literal will be wrongly interpreted as a field ordinal.
- // Convert it to a character literal, which will have the same effect.
- final String strValue = ((SqlNumericLiteral) node).toValue();
- return SqlLiteral.createCharString(strValue, node.getParserPosition());
- }
- if (node instanceof SqlCall
- && dialect.getConformance().isSortByOrdinal()) {
- // If the field is expression and sort by ordinal is set in dialect,
- // convert it to ordinal.
+ if (this instanceof SqlImplementor.AliasContext) {
+ return node;
+ }
Review Comment:
Good call, done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]