phoenix导出csv文件

w8f9ii69  于 2021-07-13  发布在  Hadoop
关注(0)|答案(1)|浏览(814)

我对hbase和phoenix还很陌生。我正在尝试将一些数据导出到csv文件。我试过了,似乎有用。

!outputformat csv
!record /data.csv
select * from “data”;
!record

我的问题是这个csv文件导出到哪里?我没有得到任何错误导出上述查询,但我似乎找不到文件本身。

vc6uscn9

vc6uscn91#

可能您的data.csv文件是在您机器的根目录中生成的,因为您的文件以 / . 通常,路径前缀将是启动 phoenix-sqlline 贝壳(实际上,路径是在开始记录之前登录到sqlline的)
例如:


## Started sqlline in /tmp/alicana directory

0: jdbc:phoenix:> !record data.csv
Saving all output to "/tmp/alicana/data.csv". Enter "record" with no arguments to stop it.

0: jdbc:phoenix:> !record ../alicana-data.csv
Saving all output to "/tmp/alicana/../alicana-data.csv". Enter "record" with no arguments to stop it.

## When sqlline started in (~) user home

0: jdbc:phoenix:> !record data.csv
Saving all output to "/home/alicana/data.csv". Enter "record" with no arguments to stop it.

## Official sqlline documentation

0: jdbc:oracle:thin:@localhost:1521:mydb> !record /tmp/mysession.out
Saving all output to "/tmp/mysession.out". Enter "record" with no arguments to stop it.

相关问题