错误:No schema specified on job or table
.
不知道为什么会发生这个错误.代码来自文档.我还try 遵循不同的格式,如fs.createWriteStream({SourceFormat:"json"})--但它导致了相同的错误.
const { BigQuery } = require("@google-cloud/bigquery");
const bigquery = new BigQuery();
const dataset = bigquery.dataset("firebase_test_data");
const table = dataset.table("flattened_data");
const fs = require("fs");
fs.createReadStream("./data.json")
.pipe(table.createWriteStream("json"))
.on("job", (job) => {
// `job` is a Job object that can be used to check the status of the
// request.
console.log(job);
})
.on("complete", (job) => {
// The job has completed successfully.
});