You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm currently switching our fork over to using the feature branch supporting ADQL 2.1. I am having some issues with getting the original column name after parsing a query that uses a column alias.
For an ADQL query like: SELECT table_name AS columnalias FROM tap_schema.tables AS tablealias
the ADQLParser successfully parses and (for SQLServer at least) translates the query into: SELECT tablealias.table_name AS columnalias FROM tap_schema.tables AS tablealias
After parsing the query, I need to perform some operations that involve getting the column's original name table_name. In our old code, we made a call to getResultingColumns(), then to getDBName()
For example, an abstract code snippet:
queryObject = parser.parseQuery("SELECT table_name AS columnalias FROM tap_schema.tables AS tablealias");
// (new SQLServerTranslator()).translate(queryObject) produces correct translation
DBColumn columns = queryObject.getResultingColumns();
columns[0].getDBName();
// "table_name"
However, in the new branch, it seems that no longer works, and instead just returns the aliased name:
columns[0].getDBName();
// "columnalias"
It seems the line of affected code comes from the commit here, where Line 437 in getResultingColumns() d341569
was changed from:
col = col.copy(col.getDBName(), alias, col.getTable());
to
col = col.copy(alias, alias, col.getTable());
Indeed, in our own code, reverting the change does fix our issue with getting the original column name, but seems to fail some of your other aliasing tests.
Any advice would be much appreciated. Thank you!
The text was updated successfully, but these errors were encountered:
Hi, I'm currently switching our fork over to using the feature branch supporting ADQL 2.1. I am having some issues with getting the original column name after parsing a query that uses a column alias.
For an ADQL query like:
SELECT table_name AS columnalias FROM tap_schema.tables AS tablealias
the ADQLParser successfully parses and (for SQLServer at least) translates the query into:
SELECT tablealias.table_name AS columnalias FROM tap_schema.tables AS tablealias
After parsing the query, I need to perform some operations that involve getting the column's original name
table_name
. In our old code, we made a call togetResultingColumns()
, then togetDBName()
For example, an abstract code snippet:
However, in the new branch, it seems that no longer works, and instead just returns the aliased name:
It seems the line of affected code comes from the commit here, where Line 437 in
getResultingColumns()
d341569
was changed from:
to
Indeed, in our own code, reverting the change does fix our issue with getting the original column name, but seems to fail some of your other aliasing tests.
Any advice would be much appreciated. Thank you!
The text was updated successfully, but these errors were encountered: