Data Studio Community Connector for Bigquery

余生长醉 提交于 2020-07-20 04:17:31

问题


Very similar to this post, Have set up a connector, but the getData() function, which is using a SQL query does not seem to be pulling any data through.

Have also used this colabs for guidance.

As far as I can see from the logs, I'm authenticating to my db fine, but it doesn't seem to be pulling anything.

this question showed an output, but I'm developing in https://script.google.com/ and I can't see how to get a readout of the query as they have done.

Update

added "useQueryConfig": true into "appsscript.json" and now getting a new error

end update

this is the error I'm getting in DS

This is the bits of my code where I think I must be missing something.

function getFields() {


var fields = cc.getFields();
  var types = cc.FieldType;

//21 VIN Text  None
  fields
    .newDimension()
    .setId('customer_id')
    .setName('customer_id')
    .setType(types.TEXT);

  return fields;
}

function getSchema(request) {
  schema = {schema: getFields().build()}
  return schema;
}
    
var BASE_SQL = 'SELECT distinct customer_id from `generic_project.boring_dataset.customer_table`';

function getData(request) {
  var accessToken = getOauthService().getAccessToken();
  var serviceAccountCreds = getServiceAccountCreds();
  var billingProjectId = serviceAccountCreds[BILLING_PROJECT_ID];
  var bqTypes = DataStudioApp.createCommunityConnector().BigQueryParameterType;
  
  cc
    .newBigQueryConfig()
    .setAccessToken(accessToken)
    .setBillingProjectId(billingProjectId)
    .setUseStandardSql(true)
    .setQuery(BASE_SQL)
    .build();
  return cc;
}

This is the admin function:

// function to allow admin
function isAdminUser() {
  return true;
}

来源:https://stackoverflow.com/questions/62384253/data-studio-community-connector-for-bigquery

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