0 votes
80 views

Hi,

I am trying to run a test query with cmd tool and it throws an error:

Error: IllegalArgumentException: Column: [rid] not found in TapSchema

The test query is:

datalab query --adql="select top 10 m.legacy_id,m.bid FROM mydb://tmp_dr2 m" --fmt="csv"

An example row of the table tmp_dr2 is like:

Source_Name,Legacy_ID,RA,DEC,rid,bid,oid

ILTJ000000.04+295526.3,8000495682000911,0.0001816635306256531,29.923996741120796,8000,495682,911

I can see the rid,bid,oid column with command: 

[zhengxc @ office split_dl] $ datalab mydb_list table="tmp_dr2"

source_name,text,

legacy_id,bigint,

ra,double precision,

dec,double precision,

rid,smallint,

bid,integer,

oid,smallint,

But if I ran query:

select * FROM mydb://tmp_dr2 limit 10

It returns a table without the three ids.

Is there any requirement on the name of columns or table to be found in TapSchema?

by isaaczheng (220 points) | 80 views

1 Answer

0 votes

Hi, thanks for reaching out.

Using your sample row and header I made a two-row CSV file, mydb_import()-ed it to MyDB, and when I run your test queries (using the datalab command), I get correct behavior in both cases. To be extra sure, when I run

datalab --version

I get '2.20.1'.

I suspect something must have gone wrong in getting your tmp_dr2 table to MyDB. If it's a CSV file that you loaded from, could you please make it available to us for testing? You could place it in your vospace, for instance in a notebook via

from dl import storeClient as sc
sc.put(fr='./myfile.csv',to='vos://public/myfile.csv')

(Note that files in vos://public/ are visible to all DL users). If you prefer, you can also email the CSV file (if it's not too big) to datalab@noirlab.edu

Best,
Robert

by robertdemo (8.0k points)
Hi,
Thanks for the response. I place the .csv file in my public (with name "test.csv").
And I also get datalab version 2.20.1.

417 questions

434 answers

440 comments

637 users

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

Categories