问题
Using google biq query client i am trying to run create routine function but it is failing with callback is not a function error
const { BigQuery } = require('@google-cloud/bigquery')
const projectId = 'bigqueryproject1-279307'
const keyFilename = '../credentials/client_secrets.json'
const bigqueryClient = new BigQuery({ projectId, keyFilename })
const dataset = bigqueryClient.dataset('babynames')
const routine = dataset.routine('analysis_routine')
async function createRoutine () {
const config = {
arguments: [{
name: 'x',
dataType: {
typeKind: 'INT64'
}
}],
definitionBody: 'x * 3',
routineType: 'SCALAR_FUNCTION',
returnType: {
typeKind: 'INT64'
}
}
const [routine1, apiResponse] = await routine.create(config)
console.log('*******apiResponse*****', apiResponse)
console.log('****routine1*********', routine1)
}
createRoutine()
回答1:
See this issue filed against repository
来源:https://stackoverflow.com/questions/62672373/creating-routine-using-google-big-query-client-returns-callback-is-not-a-funct