INTO writer

8 views
Skip to first unread message

Branimir Sesar

unread,
Nov 13, 2012, 1:59:58 PM11/13/12
to lsd-...@googlegroups.com
Dear LSD users,

I'm a bit struggling with the INTO part of LSD. I would like to store
LSD obj_ids of some sources into a temporary table before dumping light
curves. I've created a table called targets using

lsd-admin create table --drop-existing --primary-key=rr_id
--spatial-keys=ra,dec targets rr_id:u8 ra:f8 dec:f8

Then I ran a query that has

lsd-query 'SELECT obj_id as rr_id, m.ra as ra, m.dec as dec FROM ...
INTO targets'

Unfortunately, I get this error:

[1 el.]::::::::::::::::::::[1 el.]------ rolling back
20121113190024.969551 ---------

Traceback (most recent call last):
File "/home/bsesar/opt/lsd/src/lsd-query", line 96, in <module>
for row in q.iterate(bounds, progress_callback=progress_callback,
testbounds=testbounds, include_cached=include_cached, cells=cells):
File "/Data/bsesar/opt/lsd/src/lsd/join_ops.py", line 1570, in iterate
_yield_empty=_yield_empty):
File "/Data/bsesar/opt/lsd/src/lsd/join_ops.py", line 1512, in execute
for result in pool.map_reduce_chain(partspecs.items(), kernels,
progress_callback=progress_callback):
File "/Data/bsesar/opt/lsd/src/lsd/pool2.py", line 601, in
map_reduce_chain
for r in self.imap_unordered(input, K_fun, K_args,
progress_callback=progress_callback, progress_callback_stage=stage):
File "/Data/bsesar/opt/lsd/src/lsd/pool2.py", line 466, in imap_unordered
for result in mapper(item, *mapper_args):
File "/Data/bsesar/opt/lsd/src/lsd/pool2.py", line 134, in
_reduce_from_pickle_jar
for result in reducer((key, _unserializer(file, offsets)),
*reducer_args):
File "/Data/bsesar/opt/lsd/src/lsd/join_ops.py", line 2363, in
_into_writer
rows = qwriter._write(cell_id, rows)
File "/Data/bsesar/opt/lsd/src/lsd/join_ops.py", line 1045, in _write
rows = self.eval_into(cell_id, rows)
File "/Data/bsesar/opt/lsd/src/lsd/join_ops.py", line 1101, in eval_into
ids = table.append(rows)
File "/Data/bsesar/opt/lsd/src/lsd/table.py", line 1114, in append
cols.add_column(self.resolve_alias(name), col)
File "/Data/bsesar/opt/lsd/src/lsd/colgroup.py", line 386, in add_column
assert name not in self.column_map
AssertionError

Any ideas how to fix this?

Cheers,

Brani

Branimir Sesar

unread,
Nov 13, 2012, 5:14:53 PM11/13/12
to lsd-...@googlegroups.com
Ok, I figured this one out. obj_id is generated automatically in
lsd-query and I cannot use my own obj_id values. However, obj_id can be
imported into a table using lsd-import and --import-primary-keys.

B
Reply all
Reply to author
Forward
0 new messages