google-bigquery - 数据流作业+大查询
问题描述
我有以下问题:我有一个使用以下方案的大查询:
cpf: string
name: string
greaterOfAge: boolean
foreigner: boolean
我有一个 pub/sub 来发送消息,与一个使用非常简单的 UDF 函数的 DataFlow Job 对齐。仅当用户是外国人时才计算成人的价值:
function transform(inJson) {
var obj = JSON.parse(inJson);
var output = {
"cpf": obj.cpf,
"nome": obj.nome,
"greaterOfAge": true,
"foreigner": true
}
return output;
}
当我通过我的 PubSub 发布此消息时:
"cpf": "123456–789",
"nome": "Alan Turing",
"age": 20,
"origem": "Inglaterra"
但我收到此错误:
{"errors":[{"debugInfo":"","location":"origem","message":"no such field: origem.","reason":"invalid"}],"index":0}
我使用这篇文章作为参考: https ://inside.contabilizei.com.br/streaming-de-dados-com-google-cloud-dataflow-1cd6aa69bae8
解决方案
推荐阅读
- node.js - mongodb、mongoose、express、nodejs 使用旧值更新多个文档中的字符串
- python - 为什么 python 包中 __init__.py 中的命令行为与命令行不同?
- android - 如何在不使用 FFMPEG 重新编码的情况下在精确位置修剪视频文件
- android - 无法构建项目 java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
- python - 有没有办法可以计算单选按钮的累积值
- csv - 如何在批处理脚本中将文件从 xlsx 放入 csv
- python - 使用索引遍历字符串中的字符
- c# - EF Core 嵌套 ThenInclude
- ssl - 设置 SSL 后 Keycloak 在 https 上不起作用
- snakemake - Snakemake:许多 RNAseq 读取与许多基因组的 HISAT2 比对