I run hive query by java code. Example:
"SELECT * FROM table WHERE id > 100"
How to export result to hdfs file.
The following query will insert the results directly into HDFS:
INSERT OVERWRITE DIRECTORY '/path/to/output/dir' SELECT * FROM table WHERE id > 100;