5

I'm getting the following error while executing queries against a database in impala. With other databases its working fine.

Error trace is as follows.

[Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: select * from test_table limit 1, SQL state: {1}, Query: {2}.[]
java.sql.SQLException: [Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: [Simba][JSQLEngine](12010) The table "test_table"    could not be found., SQL state: HY000, Query: select count(*) from test_table.
            at     com.cloudera.impala.hivecommon.dataengine.HiveJDBCDataEngine.prepare(Unknown Source)
            at com.cloudera.impala.jdbc.common.SStatement.executeNoParams(Unknown Source)
            at com.cloudera.impala.jdbc.common.SStatement.executeQuery(Unknown Source)
Caused by: com.cloudera.impala.support.exceptions.GeneralException: [Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: [Simba][JSQLEngine](12010) The table "test_table" could not be found., SQL state: HY000, Query: select count(*) from test_table.
            ... 3 more

if I execute show tables its listing the table name.

If I execute it from hue its not displaying anything in the result.

I tried by invalidating the metadata.

I tried by changing to latest driver jdbc41 same problem.

Where might be the problem?

smali
  • 4,687
  • 7
  • 38
  • 60
  • If you use the native query mode in the driver, do you get the same error? – KylePorter Feb 22 '16 at 20:19
  • yes, its not the driver issue actually it seems some problem with impala. – smali Feb 23 '16 at 08:28
  • 1
    Is the table in a different schema, which might require it to be fully qualified? Does the table show up when you inspect the table catalog metadata? – KylePorter Feb 24 '16 at 17:37
  • I think @KylePorter has it -- I cannot find a way to avoid having to fully qualify the table name with it's scope (a.k.a database). If you only have one scope/db it may be possible to specify that in the JDBC connection string, e.g. `jdbc::impala://:21050/` -- the default scope is called `default`, so try that. If you're not able to see a result from Hue (which requires you to specify the scope), then something else is likely wrong. – Tom Harrison Feb 27 '16 at 21:52
  • @TomHarrisonJr,KylePorter, thanks for help, the problem was in the .avro file format. My teamlead has fixed it, Not sure what he has done he just said it was the problem of file format. – smali Feb 29 '16 at 14:16

2 Answers2

1

In my case, this error was caused by not having a /user/scott directory on hdfs with write permissions for the Hiveserver (running as cloudera-scm user)(my jdbc connection uses scott as the user id). Once I created the dir and chmod'ed it, I could run all queries. Earlier only select * worked but select count(*) did not.

kiru
  • 29
  • 2
  • Thanks, this worked for me. hadoop fs -mkdir /user/my_user/ && hadoop fs -chmod 777 /user/my_user/ – cangers Jan 09 '18 at 21:39
0

The problem was in the .avro file format. My teamlead has fixed it, Not sure what he has done he just said it was the problem of file format.

smali
  • 4,687
  • 7
  • 38
  • 60