从命令行检查 Parquet [英] Inspect Parquet from command line

查看:112
本文介绍了从命令行检查 Parquet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从命令行检查 Parquet 文件的内容?

How do I inspect the content of a Parquet file from the command line?

我现在看到的唯一选择是

The only option I see now is

$ hadoop fs -get my-path local-file
$ parquet-tools head local-file | less

我愿意

  1. 避免创建 local-file
  2. 将文件内容视为 json 而不是 parquet-tools 打印的无类型文本.
  1. avoid creating the local-file and
  2. view the file content as json rather than the typeless text that parquet-tools prints.

有没有简单的方法?

推荐答案

您可以将 parquet-tools 与命令 cat--json<一起使用/code> 选项,以便查看没有本地副本和 JSON 格式的文件.

You can use parquet-tools with the command cat and the --json option in order to view the files without a local copy and in the JSON format.

这是一个例子:

parquet-tools cat --json hdfs://localhost/tmp/save/part-r-00000-6a3ccfae-5eb9-4a88-8ce8-b11b2644d5de.gz.parquet

这会以 JSON 格式打印出数据:

This prints out the data in JSON format:

{"name":"gil","age":48,"city":"london"}
{"name":"jane","age":30,"city":"new york"}
{"name":"jordan","age":18,"city":"toronto"}

免责声明:这是在 Cloudera CDH 5.12.0 中测试的

Disclaimer: this was tested in Cloudera CDH 5.12.0

这篇关于从命令行检查 Parquet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆