Creating routine using google big query client returns 'callback' is not a function error

放肆的年华 提交于 2020-07-11 04:19:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!