reading from stdin in datafusion-cli? #9409
-
Am I missing something or datafusion-cli has no support for reading csv from stdin yet? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I tried this with JSON: $ cat sql
create external table test stored as json location '/dev/stdin';
select * from test;
$ cat 1.json
{ "age": 2, "name": "steve" }
$ cat 1.json |datafusion-cli -f sql
DataFusion CLI v36.0.0
0 rows in set. Query took 0.001 seconds.
0 rows in set. Query took 0.000 seconds. It won't give you error, though it won't print the rows as well.. For parquet,
$ cat sql
create external table test stored as parquet location '/dev/stdin';
select * from test;
$ pqrs cat 2.parquet
###############
File: 2.parquet
###############
{Age: 2}
$ cat 2.parquet | datafusion-cli -f sql
DataFusion CLI v36.0.0
Execution error: file size of 0 is less than footer
Error during planning: table 'datafusion.public.test' not found For CSV, it gives you an error $ cat sql
create external table test stored as csv location '/dev/stdin';
select * from test;
$ cat username.csv
Username; Identifier;First name;Last name
booker12;9012;Rachel;Booker
grey07;2070;Laura;Grey
johnson81;4081;Craig;Johnson
jenkins46;9346;Mary;Jenkins
smith79;5079;Jamie;Smith
$ cat username.csv | datafusion-cli -f sql
DataFusion CLI v36.0.0
Object Store error: Generic LocalFileSystem error: Error seeking file /dev/stdin: Illegal seek (os error 29)
Error during planning: table 'datafusion.public.test' not found |
Beta Was this translation helpful? Give feedback.
-
besides datafusion-cli, it could be much better if /dev/stdin could work with |
Beta Was this translation helpful? Give feedback.
I don't think you are missing anything -- it does not have support for reading from stdin. I think it would be a good feature.
I bet if you filed a ticket someone would try and implement it .