0
votes

After insertion of orc files into the folder of a table with hdfs copy, how to update that hive table's data to see those data when querying with hive.

Best Regards.

2

2 Answers

1
votes

If the table is not partitioned then once the files are in HDFS in the folder that is specified in the LOCATION clause, then the data should be available for querying.
If the table is partitioned then u first need to run an ADD PARTITION statement.

0
votes

As mentioned in upper answer by belostoky. if the table is not partitioned then you can directly query your table with the updated data But in case if you table is partitioned you need to add partitions first in hive table that you can do using

You can use alter table statement to add partitions like shown below

ALTER TABLE table1
    ADD PARTITION (dt='<date>')
    location '<hdfs file path>'

once partitions are added hive metastore should be aware of changes so you need to run

msck repair table table1 

to add partitions in metastore.

Once done you can query your data