Anderson Dutra
Anderson Dutra

Reputation: 101

Run Impala Refresh from Hive or Webhdfs

I am working with some tables on Imapala and querying that using a jdbc HIVE driver. I need to run a Refresh on some tables before extract data (or configure Impala to run it automatically). When i try to run refresh tablename by the jdbc driver i can't (because in HIVE this command doesn't exists - i think). I have tried to write a simple impala-shell script (refresh tablename) and run using curl like this curl -i -L "http://<server>:50070/webhdfs/v1/<path to sh file>?op=OPEN" it doesn't work too. Can someone help me? Thanks!

Upvotes: 0

Views: 934

Answers (2)

eMazarakis
eMazarakis

Reputation: 132

@Andisu : if you want to do a refresh through Impala-Shell then run the following command:

impala-shell -d db_NAME -q "REFRESH tablename"; 

-q: The impala-shell interpreter immediately exits after processing the statement within double quotes. If you do REFRESH, that means new data files were added to the HDFS location of the table by you, so the metadata of block location of these files must be loaded to Impala Daemon Coordinator.

Upvotes: 0

Morito
Morito

Reputation: 93

Please try

INVALIDATE METADATA databsename.tablename

Upvotes: 0

Related Questions