0 votes
1 view
in Big Data Hadoop & Spark by (11.5k points)

I run hive query by java code. Example:

"SELECT * FROM table WHERE id > 100"

How to export result to hdfs file.a

1 Answer

0 votes
by (24.7k points)

To directly insert the result of any hive query into HDFS file, try this command:

INSERT OVERWRITE DIRECTORY '/output/path/dir' SELECT * FROM table WHERE id > 100;

...