Skip to content

Commit

Permalink
[ADQL] Complete commit "Re-Fix GROUP BY's columns handling"
Browse files Browse the repository at this point in the history
(7a70c60)

It was not possible to use a GROUP BY with a qualified column name.
So finally, now, a GROUP BY is a ClauseADQL<ADQLColumn> instead of
a ClauseADQL<ColumnReference>. Indeed, according to the ADQL's BNF,
GROUP BY items are only columns as they would appear in the SELECT
clause (i.e. qualified or not, delimited or not). On the other
hand an ORDER BY accepts ONLY column index or non-qualified column
name/alias.

The class ColumnReference is kept for backward compatibility (or in
case the next version of the ADQL grammar make items of GROUP BY and
ORDER BY of the same type: index or qualified column). Besides, this
class is still inherited for the ORDER BY clause items
(see adql.query.ADQLOrder).
  • Loading branch information
gmantele committed Apr 4, 2017
1 parent e3be196 commit 8e2fa9f
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 195 deletions.
4 changes: 2 additions & 2 deletions src/adql/db/DBChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
* </i></p>
*
* @author Gr&eacute;gory Mantelet (CDS;ARI)
* @version 1.4 (03/2017)
* @version 1.4 (04/2017)
*/
public class DBChecker implements QueryChecker {

Expand Down Expand Up @@ -632,7 +632,7 @@ protected void resolveColumns(final ADQLQuery query, final Stack<SearchColumnLis

// Check the correctness of all column references (= references to selected columns):
/* Note: no need to provide the father tables when resolving column references,
* because no father column can be used in ORDER BY and/or GROUP BY. */
* because no father column can be used in ORDER BY. */
sHandler = new SearchColReferenceHandler();
sHandler.search(query);
ClauseSelect select = query.getSelect();
Expand Down
Loading

0 comments on commit 8e2fa9f

Please sign in to comment.