Hi,
In this page https://cloud.google.com/bigquery/streaming-data-into-bigquery it is specified that i need to use
this syntax table$20170301 to stream to a custom partition. Is is available in this library ?
Yes, it should work. Have you tried?
I have no idea how to do that!
using get https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigquery/0.9.2/bigquery/table?method=get with a tableId+partition as id?
Haha, let's figure it out! I think you just need to reference a table like:
var bigquery = require('@google-cloud/bigquery')({...})
var table = bigquery.table('table$20170301')
Let me know if this works.
Gotta wait the streamingBuffer flush... I'll keep it you updated!
Thanks :)
Back with infos!
So the decorator things works! However I ran into another issue, the insertId example in the docs yields this error:
{
"errors": [
{
"errors": [
{
"message": "no such field.",
"reason": "invalid"
}
]
}
],
"response": {
"kind": "bigquery#tableDataInsertAllResponse",
"insertErrors": [
{
"index": 0,
"errors": [
{
"reason": "invalid",
"location": "json",
"debugInfo": "generic::not_found: no such field.",
"message": "no such field."
}
]
}
]
},
"message": "A failure occurred during this request."
}
The format I'm giving to insert is this:
{
insertId: shortid.generate(),
json: data,
}
Query is valid because when I use this it inserts without problems
{
...data
}
(reference: https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigquery/0.9.2/bigquery/table?method=insert)
@stephenplusplus Did you get a chance to see this?
It sounds like maybe the options object specifying a raw request wasn't used:
var row = {
insertId: '1',
json: {
INSTNM: 'Motion Picture Institute of Michigan',
CITY: 'Troy',
STABBR: 'MI'
}
};
var options = {
raw: true
};
table.insert(row, options, insertHandler);
That's it worked! Silly me.. Thanks for your help