Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

SHOW TABLE STATS Statement throws error in Hive 1.1.0

avatar
Expert Contributor

I am executing the query `SHOW TABLE STATS sampletable;` in Hive (1.1.0) and it throws the below error.

    hive> show table stats sampletable;
    MismatchedTokenException(26!=105)
            at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617)
            at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
            at org.apache.hadoop.hive.ql.parse.HiveParser.showStatement(HiveParser.java:21074)
            at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:2439)
            at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1586)
            at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1062)
            at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:201)
            at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
            at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:404)
            at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:305)
            at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1119)
            at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1167)
            at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1055)
            at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1045)
            at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:207)
            at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:159)
            at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:370)
            at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:757)
            at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
            at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
            at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
    FAILED: ParseException line 1:11 mismatched input 'stats' expecting EXTENDED near 'table' in show statement 

I am using CDH 5.5.2 I have checked cloudera's document on this particular hive statement and looks like I am executing the right query. Here is the link to it. Not sure what the MismatchedTockenException is. Any help is on this, please?

1 ACCEPTED SOLUTION

avatar
@Alex Raj

Have you run compute stats before running show table stats?

View solution in original post

5 REPLIES 5

avatar
@Alex Raj

Have you run compute stats before running show table stats?

avatar
Expert Contributor

No @Sindhu.

I have not

avatar
@Alex Raj

Were you able to see the stats post compute stats on the table?

avatar
Expert Contributor

Hi @Sindhu, thanks for your followup. I was able to get the stats using the below query. Thank you again for your effort.

analyze table sampletable partition (year) compute statistics noscan;

avatar
@Alex Raj

Please mark best answer to close the discussion.