0 votes
20 views
asked Oct 29 by schech (140 points) | 20 views

2 Answers

0 votes

Hi, with the minimal example below I can not reproduce the error that you report:

from dl import authClient as ac, queryClient as qc
from dl.helpers.utils import convert
token = ac.login('anonymous')
query = 'SELECT coadd_object_id, ra, dec, w1mpro, w2mpro FROM des_dr1.des_allwise WHERE w2mpro < 15.6 AND 0.2 < (w1mpro - w2mpro)'
result = qc.query(token,query)
df = convert(result,'pandas')
print(df.head())

This prints:

   coadd_object_id         ra        dec  w1mpro  w2mpro
0        365874111  53.835287 -23.136150  15.419  15.215
1        365872277  53.837476 -23.102668  15.153  14.936
2        369433639  53.886171 -23.210287  16.364  15.481
3        365875473  53.854954 -23.162378  15.412  15.095
4        369436438  53.943101 -23.238697  15.632  15.359

Would you mind pasting here your minimal example? Thanks!

answered Oct 29 by anonymous
I am using the web query, not a query client.
Here is what I paste into the dialog box.

SELECT coadd_object_id, ra, dec, w1mpro, w2mpro FROM des_dr1.des_allwise WHERE w2mpro < 15.6 AND 0.2 < (w1mpro - w2mpro)

Interestingly the process seems to continue a long time after the error appears.
I wonder if processing stops if it simply skips that line.
Aha, the output table doesn't have the w1mpro and w2mpro values.

Here is the error message from the web interface:

Error: IllegalArgumentException: net.sf.jsqlparser.JSQLParserException JSQLParserException: ParseException: Encountered "," at line 1, column 15. Was expecting one of: "NULL" ... "CASE" ... "REPLACE" ... <S_DOUBLE> ... <S_INTEGER> ... <S_IDENTIFIER> ... <S_CHAR_LITERAL> ... <S_QUOTED_IDENTIFIER> ... "(" ... "*" ... "?" ... "+" ... "-" ... "{d" ... "{t" ... "{ts" ... "{fn" ...
0 votes

From the database logs I found the query:

SELECT coadd_object_id,, ra, dec, w1mpro, w2mpro FROM des_dr1.des_allwise WHERE w2mpro < 15.6 AND 0.2 < (w1mpro - w2mpro)

i.e. the error is a double-comma following the 'coadd_object_id' field.

answered Oct 29 by datalab (3,880 points)
This is what I cut and pasted into the web query.  
I did it again just to be certain.  No double comma.
Sorry to be a nuisance, I'm just beginning this SQL stuff and trying to
make sense of it.

SELECT coadd_object_id, ra, dec, w1mpro, w2mpro FROM des_dr1.des_allwise WHERE w2mpro < 15.6 AND 0.2 < (w1mpro - w2mpro)

98 questions

85 answers

35 comments

464 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.