使用Google Big查询客户端创建例程返回“回调"不是函数错误 [英] Creating routine using google big query client returns 'callback' is not a function error

查看:33
本文介绍了使用Google Big查询客户端创建例程返回“回调"不是函数错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Google Biq查询客户端运行创建例程函数,但由于回调失败而失败不是函数错误

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()

推荐答案

请参见此问题提交到存储库

这篇关于使用Google Big查询客户端创建例程返回“回调"不是函数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆