I think the problem is simple, but I'm missing something. Here is my code:
const schema = {
fields: [
{ name: 'sku', type: 'STRING' },
{ name: 'date', type: 'STRING' },
{ name: 'day', type: 'STRING' },
{ name: 'brand', type: 'STRING' },
]
};
const table = {
tableReference: {
projectId: projectId,
datasetId: datasetId,
tableId: tableId
},
schema: schema
};
try {
table = BigQuery.Tables.insert(table, projectId, datasetId);
console.log('Table created: %s', table.id);
} catch (err) {
console.log('unable to create table');
}
const data = new_blob_answer_CSV();
console.log(data.getDataAsString());
const job = {
configuration: {
load: {
destinationTable: {
projectId: projectId,
datasetId: datasetId,
tableId: tableId
},
source_format: 'CSV',
schema: schema
}
}
};
Please help, thanks in advance. 😋
This code **OVERWRITES **the data to the table, but i need to ADD it to the old one.
WRITE_DISPOSITION_UNSPECIFIED - Unknown.
WRITE_EMPTY This - job should only be writing to empty tables.
WRITE_TRUNCATE - This job will truncate the existing table data.
WRITE_APPEND - This job will append to the table.