Support Questions

Find answers, ask questions, and share your expertise

Check table stats for all tables

avatar
Explorer

I'd like to update stats (compute stats) for every table I have.  I have a ton of queries that are running without them.  I personally have access only to Hue for Impala, no console kind of access to server or anything.  I'm able to see status of stats for a table with describe formatted <table>, but it's a major pain to look through, and I have a ton of tables.

 

Is there any way to get a list of all tables and the status of their stats from Hue?

 

Thanks!

1 ACCEPTED SOLUTION

avatar
Master Collaborator

Hi,

I do not think we have a command to check all the table stats in one go, If you would like to update the stats on all tables i think you should prepare a custom script for it.

-> List all the tables from "show tables" command

-> copy the table names and run "show table stats <table-name>" on all the tables.

-> And then "compute stats <table-name>" on all the tables.

 

You can make a custom shell script with a for loop to run the compute stats on all the tables. All this should be done from terminal.

View solution in original post

2 REPLIES 2

avatar
Master Collaborator

Hi,

I do not think we have a command to check all the table stats in one go, If you would like to update the stats on all tables i think you should prepare a custom script for it.

-> List all the tables from "show tables" command

-> copy the table names and run "show table stats <table-name>" on all the tables.

-> And then "compute stats <table-name>" on all the tables.

 

You can make a custom shell script with a for loop to run the compute stats on all the tables. All this should be done from terminal.

avatar
Explorer

That's what I was afraid of.  I'm going through Cloudera Manager and looking at queries where missing_stats=true and going through one by one more or less.  Thanks for the response!