我正在按如下方式对DataFrame进行分区:
df.write.partitionBy("type", "category").parquet(config.outpath)
Run Code Online (Sandbox Code Playgroud)
代码给出了预期的结果(即按类型和类别划分的数据).但是,"type"和"category"列将从数据/模式中删除.有没有办法防止这种行为?
我有一个在多线程环境中使用的 asyncio gRPC 客户端。当多个线程同时通过客户端连接到服务时,我看到以下错误流:
2021-01-27 09:33:56,937 错误 [asyncio] [thread_0] 回调 PollerCompletionQueue._handle_events()() 中出现异常
处理: )()>
回溯(最近一次调用最后一次):
文件“/usr/local/lib/python3.8/asyncio/events.py”,第 81 行,在 _run 中
self._context.run(self._callback, *self._args)
文件“src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi”,第 147 行,位于 grpc._cython.cygrpc.PollerCompletionQueue._handle_events 中
BlockingIOError:[Errno 11] 资源暂时不可用
2021-01-27 09:33:56,937 错误 [asyncio] [thread_1] 回调 PollerCompletionQueue._handle_events()() 中出现异常
处理: )()>
回溯(最近一次调用最后一次):
文件“/usr/local/lib/python3.8/asyncio/events.py”,第 81 行,在 _run 中
self._context.run(self._callback, *self._args)
文件“src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi”,第 147 行,位于 grpc._cython.cygrpc.PollerCompletionQueue._handle_events 中
BlockingIOError:[Errno 11] 资源暂时不可用
这些请求似乎已成功完成,但是,这些消息充斥着我的日志,让我感到紧张!
在我的测试中,每个线程创建自己的通道并提交自己的异步请求。无论服务负载如何,都会发生错误。如果客户端在不同进程中运行,则不会发生错误。
我的设置:
3.8.6grpcio版本:1.35.0任何见解表示赞赏!
python python-multithreading python-asyncio grpc grpc-python