/** * Validates an item in the ORDER BY clause of a SELECT statement. * * @param select Select statement * @param orderItem ORDER BY clause item */ private void validateOrderItem(SqlSelect select, SqlNode orderItem) { switch (orderItem.getKind()) { case DESCENDING: validateFeature(RESOURCE.sQLConformance_OrderByDesc(), orderItem.getParserPosition()); validateOrderItem(select, ((SqlCall) orderItem).operand(0)); return; } final SqlValidatorScope orderScope = getOrderScope(select); validateExpr(orderItem, orderScope); }
@Test public void testOrderByDesc() { checkFeature( "select name from dept order by ^name desc^", RESOURCE.sQLConformance_OrderByDesc()); }
@Test public void testOrderByDesc() { checkFeature( "select name from dept order by ^name desc^", RESOURCE.sQLConformance_OrderByDesc()); }
/** * Validates an item in the ORDER BY clause of a SELECT statement. * * @param select Select statement * @param orderItem ORDER BY clause item */ private void validateOrderItem(SqlSelect select, SqlNode orderItem) { switch (orderItem.getKind()) { case DESCENDING: validateFeature(RESOURCE.sQLConformance_OrderByDesc(), orderItem.getParserPosition()); validateOrderItem(select, ((SqlCall) orderItem).operand(0)); return; } final SqlValidatorScope orderScope = getOrderScope(select); validateExpr(orderItem, orderScope); }
/** * Validates an item in the ORDER BY clause of a SELECT statement. * * @param select Select statement * @param orderItem ORDER BY clause item */ private void validateOrderItem(SqlSelect select, SqlNode orderItem) { switch (orderItem.getKind()) { case DESCENDING: validateFeature(RESOURCE.sQLConformance_OrderByDesc(), orderItem.getParserPosition()); validateOrderItem(select, ((SqlCall) orderItem).operand(0)); return; } final SqlValidatorScope orderScope = getOrderScope(select); validateExpr(orderItem, orderScope); }