Documents are not returned with SQL interface
Step to reproduce:
-
Create space and insert documents as in sample tarantool> box.schema.create_space('TEST_DOC', {if_not_exists = true}) tarantool> doc.create_index(box.space.TEST_DOC, 'primary',{parts={'id', 'unsigned'}, if_not_exists=true}) tarantool> doc.insert(box.space.TEST_DOC, {id=1, foo="foo", bar={baz=3}})
-
Verify that data is inserted tarantool> for _, r in doc.select(box.space.TEST_DOC) do print('tuple:', json.encode(r)) end
tuple: {"bar":{"baz":3},"foo":"foo","id":1}
---
...
- Select data with SQL interface tarantool> box.sql.execute([[select * from TEST_DOC]]);
Expected: tuples with documents.
Actual: SQL error
- error: 'no such table: TEST_DOC'
...
Additional data: tarantool> box.sql.execute([[SELECT * FROM _space;]])
- [528, 1, 'TEST_DOC', 'memtx', 0, !!binary gA==, !!binary k4OkdHlwZah1bnNpZ25lZKRuYW1lomlkq2lzX251bGxhYmxlwoOkdHlwZaZzY2FsYXKkbmFtZadiYXIuYmF6q2lzX251bGxhYmxlw4OkdHlwZaZzdHJpbmekbmFtZaNmb2+raXNfbnVsbGFibGXD]
tarantool> box.info.version
---
- 1.8.3-77-ge5b5dbc
...
This is not implemented yet. Only those spaces created using SQL itself might be queried. We're now working on support of making well-formatted spaces visible from SQL. Well-formatted means at least:
- space_format should be specified for space
- primary index should be defined for space
Only those fields will be accessible from SQL which are defined in space_format.
@kkorsakov So, basically you need to wait for this feature to land in the tarantool 1.8. After that you'll be able to perform the queries as you describe.
I'll leave the ticket open for now.
Ok, thanks!