[英]Data Studio Custom Connector wrong amount of fields
New to Data Studio Custom connectors. Data Studio 自定义连接器的新功能。 I've been able to get the tutorials right, but having trouble when doing anything more advanced.
我已经能够正确地学习教程,但是在做任何更高级的事情时遇到了麻烦。 The following is what my getData() function returns:
以下是我的 getData() function 返回的内容:
{
"schema": [
{
"semantics": {
"semanticType": "TEXT",
"conceptType": "DIMENSION"
},
"name": "Series",
"dataType": "STRING",
"label": "Series"
},
{
"name": "$overall",
"dataType": "NUMBER",
"semantics": {
"conceptType": "METRIC",
"semanticType": "NUMBER",
"isReaggregatable": true
},
"defaultAggregationType": "SUM"
},
{
"name": "undefined",
"defaultAggregationType": "SUM",
"semantics": {
"isReaggregatable": true,
"semanticType": "NUMBER",
"conceptType": "METRIC"
},
"dataType": "NUMBER"
},
{
"dataType": "NUMBER",
"defaultAggregationType": "SUM",
"semantics": {
"isReaggregatable": true,
"conceptType": "METRIC",
"semanticType": "NUMBER"
},
"name": "Student"
},
{
"semantics": {
"semanticType": "NUMBER",
"isReaggregatable": true,
"conceptType": "METRIC"
},
"name": "Teacher",
"defaultAggregationType": "SUM",
"dataType": "NUMBER"
},
{
"defaultAggregationType": "SUM",
"semantics": {
"conceptType": "METRIC",
"isReaggregatable": true,
"semanticType": "NUMBER"
},
"name": "Principal",
"dataType": "NUMBER"
},
{
"dataType": "NUMBER",
"defaultAggregationType": "SUM",
"semantics": {
"semanticType": "NUMBER",
"conceptType": "METRIC",
"isReaggregatable": true
},
"name": "Assistant"
},
{
"dataType": "NUMBER",
"semantics": {
"conceptType": "METRIC",
"semanticType": "NUMBER",
"isReaggregatable": true
},
"name": "Staff",
"defaultAggregationType": "SUM"
}
],
"rows": [
{
"values": [
"All Events - Unique",
1338,
1137,
987,
112,
10,
9,
1
]
}
]
}
You'll notice the number of fields in the schema - 8 - matches the number of fields in the data row.您会注意到架构中的字段数 - 8 - 与数据行中的字段数相匹配。
In addition, all 8 of the fields show up fine in Data Studio.此外,所有 8 个字段在 Data Studio 中都显示良好。 But when I try to actually use a stat by placing a graph or Scorecard into DS, I get the following:
但是当我尝试通过将图表或记分卡放入 DS 中来实际使用统计信息时,我得到以下信息:
System Error Data Studio has encountered a system error.
系统错误 Data Studio 遇到系统错误。
The number of columns received in the data returned from the community connector does not match the number of columns requested by Data Studio.
从社区连接器返回的数据中收到的列数与 Data Studio 请求的列数不匹配。 Please report the issue to the provider of this community connector if this issue persists.
如果此问题仍然存在,请将此问题报告给此社区连接器的提供商。
Anything obvious that I have wrong here?有什么明显的我在这里错了吗?
Thanks in advance.提前致谢。
My misunderstanding here was a general one.我在这里的误解是普遍的。 When I select a single or multiple fields from Data Studio, getData() needs to be called for just the applicable fields , which are sent through in the request.fields parameter.
当我 select 来自 Data Studio 的单个或多个字段时,只需为适用的字段调用 getData(),这些字段通过 request.fields 参数发送。 It needs to then return the filtered out schema and the filtered out row data.
然后它需要返回过滤掉的架构和过滤掉的行数据。
I saw that the fields had some filtering in the tutorial, and just didn't put two and two together.看到教程里面字段有一些过滤,只是没有把两个和两个放在一起。 I would have thought DS would have been smart enough to receive all the data, and then filter out what it needed, but that's not the way it works.
我本以为 DS 会足够聪明,可以接收所有数据,然后过滤出它需要的数据,但它不是这样工作的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.