Created 04-05-2017 03:46 PM
Hi,
I'm new on hadoop and today I try to create a csv file from an orc file.
I can display orc contents with :
hive --orcfiledump file:///root/myORCfile
and I got another text file with the original table structure (col names, types etc..) created from a "describe table" sql command.
I also know how to export a table from hive to a local csv.
However, I'm wondering if it exists any solution to convert my orc file into a simple hive table. I also try to know if it is possible to directly convert orc to csv.
Created 04-05-2017 05:47 PM
Create an external hive table with ORC and point it to your ORC file location.
CREATE EXTERNAL TABLE IF NOT EXISTS mytable (col1 bigint,col2 bigint) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS ORC location '<ORC File location'; I dont think you can convert an ORC into csv directly. But you can write an UDF to do it.
Created 04-11-2017 02:50 PM
Thanks a lot for your answer. When I execute your query, I get almost only NULL values within my table (other are kind of binaries data). I also tried with :
"orc.compress"="ZLIB" and "orc.compress.size"=65536 But nothing changed. Any ideas ?
Created 04-11-2017 03:10 PM
Check the delimiter which you used in creating external table is correct.
Also could you share the sample data and DDL which you have used to create the hive table? I dont think the compression property or size will be the reason for the issue.