-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADQL parsing error on: distance(centroid(s_region),point('',187.48, 2.05)) #19
Comments
For the record, this happens on our implementation, that uses a SQLServer backend, but the error comes from the parser, that expects either a |
Yes, exactly. The parser is accepting only a I could easily change this behaviour, but my parser would not follow anymore the standard. In theory it is not a real big deal, but TOPCAT is using it in its ADQL editor. Maybe it could be possible to make this part of the next version of ADQL (v2.1). |
A way to get round this grammar issue would be with the following ADQL query:
Ugly, but it should do what is expected. |
ADQL 2.1 already specifies that DISTANCE works between two geometries:
|
Not according to the following:
And also to the grammar definition:
|
I would say that, at the very least, the standard is not clear on this point (pun intended):
By the way, the reference does not exist. |
Your proposed get-around (ugly, but interesting!) query returns an error:
You might want to have a look at that too. |
A first comment to both of you: the ADQL library is not yet adapted for ADQL 2.1. So the function CAST, for instance, can not yet work. Then, @almicol, I admit to be a bit puzzled. This query passes the ADQL query validation on the validator of the website (http://cdsportal.u-strasbg.fr/adqltuto/validator.html) which is using the last stable version, and passes also the validation on the new on-development version on my computer.
|
Agreed, it's not in 2.0, I was quoting 2.1 only because you said it could be included in 2.1, but the current draft is not very clear. We are using my fork, where I added the support for the geometry in SQLServer. For the record, I forked from the trunk, not from the stable version, so it may be something there. |
It looks like you changed this method in
from:
|
Indeed, but it is actually not the problem. It turns out that I declared the wrong return type for To get this correction, either you update your fork with the last version of my repository, or you apply the correction by yourself after having read my last commit. I recommend you the first solution because it will avoid you merge issues later. By the way, I could also import your SQLServer translation corrections ( |
The grammar issue about the function |
Hi Gregory,
A query like:
SELECT top 10 centroid(s_region), distance(centroid(s_region),point('', 187.48, 2.05))
FROM ivoa.ObsCore
returns the error:
Incorrect ADQL query: Encountered "centroid". Was expecting one of: "POINT" """ <REGULAR_IDENTIFIER> "POINT" <REGULAR_IDENTIFIER> """
Though, CENTROID does return a POINT.
Using distance( cast(centroid(s_region) as POINT), point('', 187.48, 2.05) ) does not help.
Hope you could have a look.
Many thanks in advance,
Alberto
The text was updated successfully, but these errors were encountered: