scala - Scala - 将数据帧作为二进制文件写入文件
问题描述
我有一个镶木地板类型的蜂巢表,列Content
存储各种文档为 base64 编码。
现在,我需要读取该列并将其写入 HDFS 中的文件,以便将 base64 列转换回每一行的文档。
val profileDF = sqlContext.read.parquet("/hdfspath/profiles/");
profileDF.registerTempTable("profiles")
val contentsDF = sqlContext.sql(" select unbase64(contents) as contents from profiles where file_name'file1'")
现在contentDF
将文档的二进制格式存储为一行,我需要将其写入文件。尝试了不同的选项,但无法将数据框内容恢复到文件中。
感谢您对此的任何帮助。
解决方案
推荐阅读
- c - 如何正确管理 pthread
- ruby - 对我正在执行依赖注入的方法进行单元测试
- nativescript - 使用 nativescript angular 为 RadCharts 中的每个条形图显示不同的图例
- python - Numpy:在循环中使用 npz 格式的 savez 保存多个数组
- javascript - 带有返回函数和 sinon 的存根函数?
- python-3.x - 所有用户的 Pip3 安装模块
- javascript - React 的 createContext 工厂函数有什么意义?
- r - Geosphere 的距离矩阵:避免重复计算
- javascript - Javascript在按钮单击时运行2个函数,带有多个按钮和相同的类
- python - 加速 CSV 文件上的 python 代码操作