-
Hi! I am trying to create a new table from an array of objects in an Observable Notebook. The notebook is here: https://observablehq.com/d/9b67ff4f405dd5d8 And here's the relevant cell: {
const someData = [
{ key1: "a", key2: 1 },
{ key1: "b", key2: 2 }
];
const arrowTable = arrow.tableFromJSON(someData);
await c.insertArrowTable(arrowTable, {
name: "someData"
});
return await c.query("select * from someData");
} But I get this error:
What am I doing wrong? :'( |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi! I have to review wether this could be made simpler for users, but for now you can create the table explicitly like: {
const someData = [
{ key1: "a", key2: 1 },
{ key1: "b", key2: 2 }
];
await c.query("CREATE TABLE someData(key1 VARCHAR, key2 integer)"); // <----- create table via SQL
const arrowTable = arrow.tableFromJSON(someData);
await c.insertArrowTable(arrowTable, {
name: "someData"
});
return await c.query("select * from someData");
} |
Beta Was this translation helpful? Give feedback.
-
Hi guys, did you ever get this working? I've tried all manner of options and still don't get anything out of insertArrowTable #1640 I've tried multiple versions too, and if you have a version that worked for you would def appreciate letting us know what worked. Thanks |
Beta Was this translation helpful? Give feedback.
Hi! I have to review wether this could be made simpler for users, but for now you can create the table explicitly like: