gmantele / vollt

Java libraries implementing the IVOA protocol: ADQL, UWS and TAP
http://cdsportal.u-strasbg.fr/taptuto/
29 stars 28 forks source link

Duplicated `ON` keyword with `ADQLQuery.toADQL()` #119

Open gmantele opened 4 years ago

gmantele commented 4 years ago

A second ON keyword appears in a query using an INNER JOIN when asking for the ADQL representation of the syntactic tree returned by the ADQL parser.

For instance:

String query = "SELECT * FROM table1 t1 INNER JOIN table2 t2 ON t1.id = t2.id";
ADQLQuery a = (new ADQLParser()).parseQuery(query);
System.out.println("Input query: " + query);
System.out.println("Query after parsing: " + a.toADQL());

The output is then:

Input query: SELECT * FROM table1 t1 INNER JOIN table2 t2 ON t1.id = t2.id
Query after parsing: SELECT * FROM table1 t1 INNER JOIN table2 t2 ON ON t1.id = t2.id
                                                                  ^^^^^
gmantele commented 4 years ago

This issue does not affect either the syntactic tree or the SQL translation. Both are still correct.

This only happens when using the function toADQL() on an ADQLQuery object (or an ClauseConstraints object). This is a manual addition of the keyword ON that should not be here.