How to update table with LINESTRING data structure


#1

Hello,
I have used the following sql to create a table:
create table testcreate(line LINESTRING);

And when I wanted to update the line string in the table, I got the error message like this:
image

So I am wondering if MapD really doesn’t support the update operation of geo data structure now or there is a syntax error in my sql command.


#2

@xbsss i’m assuming you’re on 4.x, but what specific version are you using? We’re doing quite a few updates to geospatial operations with every minor and maintenance release right now.


#3

Thanks for replying me. I am using the community edition. After seeing your message, I used the apt install mapd command to upgrade, it indeed upgraded my mapd. But after upgrading, I try the update sql again, it still doesn’t work, says “UPDATE of a none-encoding string, geo, or array column is unsupported”.

image


#4

Hi @xbsss,

Currently MapD does not support updates on variable-length data, but that is currently being addressed and will land in a upcoming release.

Regards


#5

Hi @darwin,

Since the update operation can’t work yet, so I try to use the stream insert according to your example (here is the link: https://github.com/mapd/mapd-core/blob/master/SampleCode/StreamInsert.cpp).

But it seems that the load_table() method doesn’t support the LINESTRING structure. Here is the error message:
image

Actually the table test_odlines I used only have two columns: lineID, mapd_geo, but I know when I insert the LINESTRING data, system would automatically create another three columns: rowid, mapd_geo_coords, mapd_geo_bounds.

Therefore, when I use load_table() method, system asks me to provide another three columns’ data (rowid, coords, bounds), but I can’t, I don’t know how to calculate them, especially the coords.