storage.googleapis.com的Bigquery Storage API gRPC HTTP状态400

如何解决storage.googleapis.com的Bigquery Storage API gRPC HTTP状态400

我正在为R构建BigQuery Storage Client。其中一部分涉及大量调试,编译,读取代码等...

我正尝试使用grpc_cli复制基本的python示例,以了解为什么我的实现在通过Python时会被storage.googleapis.com拒绝。我想我知道我要发送的内容。我认为它会产生相同的gRPC请求,但显然不会。

由于该死的googleapis服务器仍返回400,我可能仍然缺少一些东西。我要进行有线通讯和嗅探数据包,但是如果不必学习如何做,那也很好。 / p>

# export GRPC_TRACE=all
# export GRPC_VERBOSITY=DEBUG

unset GRPC_TRACE
export GRPC_VERBOSITY=ERROR
export GOOGLE_APPLICATION_CREDENTIALS="bq-storage-dev.json"

grpc_cli call bigquerystorage.googleapis.com:443 google.cloud.bigquery.storage.v1.BigQueryRead/CreateReadSession --protofiles google/cloud/bigquery/storage/v1/storage.proto --proto_path ~/bigrquerystorage/inst/proto --channel_creds_type=gdc --json_output --binary_input --infile=~/request.bin --noremotedb --metadata=x-goog-request-params:read_session.table=projects/bigquery-public-data/datasets/usa_names/tables/usa_1910_current:x-goog-api-client:bigrquerystorage%20gl-r/4.0.3x86_64-pc-linux-gnu%20grpc/13.0.0_geeky%20gccl/0.2.0%20gargle/0.5.0

request.bin是会话对象的二进制内容

> serialize(session,NULL)
  [1] 0a 22 70 72 6f 6a 65 63 74 73 2f 6c 61 62 6f 2d 62 72 75 6e 6f 74 72 65 6d 62 6c 61
 [29] 79 2d 32 35 33 33 31 37 12 71 18 01 32 48 70 72 6f 6a 65 63 74 73 2f 62 69 67 71 75
 [57] 65 72 79 2d 70 75 62 6c 69 63 2d 64 61 74 61 2f 64 61 74 61 73 65 74 73 2f 75 73 61
 [85] 5f 6e 61 6d 65 73 2f 74 61 62 6c 65 73 2f 75 73 61 5f 31 39 31 30 5f 63 75 72 72 65
[113] 6e 74 42 23 0a 04 6e 61 6d 65 0a 06 6e 75 6d 62 65 72 0a 05 73 74 61 74 65 12 0c 73
[141] 74 61 74 65 20 3d 20 22 57 41 22 18 01
> rawToChar(serialize(session,NULL))
[1] "\n\"projects/labo-brunotremblay-253317\022q\030\0012Hprojects/bigquery-public-data/datasets/usa_names/tables/usa_1910_currentB#\n\004name\n\006number\n\005state\022\fstate = \"WA\"\030\001"

非常感谢您的帮助

编辑: 相当于Python的request.bin,效果很好。

>>> from google.cloud.bigquery_storage_v1.types import storage
>>> request_serializer=storage.CreateReadSessionRequest.serialize
>>> request = storage.CreateReadSessionRequest(None)
>>> request.parent = parent
>>> request.read_session = requested_session
>>> request.max_stream_count = 1
>>> request_serializer(request)
b'\n"projects/labo-brunotremblay-253317\x12q\x18\x012Hprojects/bigquery-public-data/datasets/usa_names/tables/usa_1910_currentB#\n\x04name\n\x06number\n\x05state\x12\x0cstate = "WA"\x18\x01'

解决方法

因此,我弄清楚了如何构建BigQuery Storage R Client。 https://github.com/meztez/bigrquerystorage

使用grpc_cli访问BigQuery Storage API是错误的方法。

我需要使用protoc生成样板代码,然后从生成的代码构建客户端。

此后,只需要将protobuf字段映射到R输入并添加正确的凭据构建器即可。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)> insert overwrite table dwd_trade_cart_add_inc > select data.id, > data.user_id, > data.course_id, > date_format(
错误1 hive (edu)> insert into huanhuan values(1,'haoge'); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive> show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 <configuration> <property> <name>yarn.nodemanager.res