Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in Big Data Hadoop & Spark by (11.4k 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 (32.3k points)
edited by

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;

You can refer the following video tutorial which will clear all your doubts regarding Hadoop:


Browse Categories