dbeaver / dbeaver

Free universal database tool and SQL client
https://dbeaver.io
Apache License 2.0
39.2k stars 3.39k forks source link

Bug: dbeaver connect hbase using phoenix,click the table Data button,throw the error. #1900

Closed Hackeruncle closed 6 years ago

Hackeruncle commented 7 years ago

Env: dbeaver: 4.0.5 phoenix: phoenix-4.11-HBase-1.2 hbase: 1.2.0(CDH5.11)

Steps:

  1. I config the dbeaver connecting the hbase using phoenix.
  2. I create the schema and table in the script of dbeaver.
CREATE SCHEMA JYDW;
CREATE TABLE JYDW.USERINFO(id bigint not null primary key, name varchar  null,age integer  null, address varchar null) ;
upsert into JYDW.USERINFO(id,name,age,address) values(1,'name1',11,'china1');
SELECT * from JYDW.USERINFO ;    

These create and upsert and select sql are successful. And I create spark project with scala, operating the table "JYDW.USERINFO", also is successful.

  1. But, I select the connection(HBase) and refresh, and I find that the table name is "USERINFO" without the schema info ,instead of "JYDW.USERINFO".

4.Then I click the "USERINFO" table, and again click the "Data" button, throw the error: SQL Error [1012] [42M03]: ERROR 1012 (42M03): Table undefined. tableName=USERINFO org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=USERINFO

error

5.I think that the table is lost the schema info in Dbeaver,so that leads to this error. @serge-rider Please help to see it, thankyou.

serge-rider commented 7 years ago

For some reason DBeaver didn't read list of phoenix schemas.

Hackeruncle commented 7 years ago

@serge-rider thanks for response.

tati-kru commented 7 years ago

It looks like this question was solved. It will be closed.

serge-rider commented 6 years ago

This seems to be still there. Please post debug log (https://github.com/serge-rider/dbeaver/wiki/Log-files) - perhaps some warnings may explain what happened.

Hackeruncle commented 6 years ago

@serge-rider 1.The debug log:

2017-09-18 01:43:54.053 - DBeaver 4.2.0 is starting
2017-09-18 01:43:54.055 - Install path: 'D:\software\dbeaver'
2017-09-18 01:43:54.056 - Instance path: 'file:/C:/Users/wujipeng/.dbeaver4/'
2017-09-18 01:43:54.060 - Memory available 981Mb/3641Mb
2017-09-18 01:43:54.073 - Starting RMI server at 49777
2017-09-18 01:43:54.114 - Run workbench
2017-09-18 01:43:56.204 - Initializing DBeaver 4.2.0
2017-09-18 01:43:56.210 - Host plugin: org.jkiss.dbeaver.core.application 4.2.0
2017-09-18 01:43:56.215 - Initialize Core...
2017-09-18 01:43:56.451 - Core initialized (236ms)
2017-09-18 01:43:56.456 - Configure workbench window
2017-09-18 01:43:56.521 - Create actions
2017-09-18 01:43:56.524 - Disable Eclipse action set 'org.eclipse.ui.edit.text.actionSet.annotationNavigation'
2017-09-18 01:43:56.529 - Disable Eclipse action set 'org.eclipse.ui.WorkingSetActionSet'
2017-09-18 01:43:57.180 - Initialize workbench window
2017-09-18 01:43:57.207 - Finish initialization
2017-09-18 01:44:00.430 - Connect with '2CDH-HBase' (phoenix_hbase-15d9d36bc91-180b1179846e67d1)
九月 18, 2017 1:44:00 上午 org.apache.hadoop.util.NativeCodeLoader <clinit>
警告: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
17/09/18 01:44:01 INFO query.ConnectionQueryServicesImpl: An instance of ConnectionQueryServices was created.
九月 18, 2017 1:44:01 上午 org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper <init>
信息: Process identifier=hconnection-0x12d34100 connecting to ZooKeeper ensemble=192.168.17.37:2181,192.168.17.38:2181,192.168.17.40:2181,192.168.17.41:2181,192.168.17.42:2181
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.5-cdh5.12.0--1, built on 06/29/2017 11:28 GMT
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:host.name=IT-WuJiPeng.sh-jiuye.com.cn
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:java.version=1.8.0_144
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:java.home=C:\jre1.8.0_144
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:java.class.path=D:\software\dbeaver\\plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:java.library.path=D:\software\dbeaver;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/jre1.8.0_144/bin/server;C:/jre1.8.0_144/bin;C:/jre1.8.0_144/lib/amd64;%JAVA_HOME/bin;%HADOOP_HOME/bin;D:\software\chromedriver_win32;D:\software\phantomjs-2.1.1-windows\bin;D:\software\MongoDB\Server\3.4\bin;D:\software\python3.6.1;D:\software\python3.6.1\Scripts;D:\software\apache-maven-3.3.9\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Lenovo\Fingerprint Manager Pro\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;D:\software\PBB Reader\x64\;D:\software\TortoiseSVN\bin;D:\software\OpenVPN\bin;D:\software\dbeaver;;.
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=C:\Users\wujipeng\AppData\Local\Temp\
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:os.name=Windows 7
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:os.version=6.1
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:user.name=wujipeng
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:user.home=C:\Users\wujipeng
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Client environment:user.dir=D:\software\dbeaver
17/09/18 01:44:01 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=192.168.17.37:2181,192.168.17.38:2181,192.168.17.40:2181,192.168.17.41:2181,192.168.17.42:2181 sessionTimeout=90000 watcher=hconnection-0x12d341000x0, quorum=192.168.17.37:2181,192.168.17.38:2181,192.168.17.40:2181,192.168.17.41:2181,192.168.17.42:2181, baseZNode=/hbase
17/09/18 01:44:01 INFO zookeeper.ClientCnxn: Opening socket connection to server hadoop41.jiuye/192.168.17.41:2181. Will not attempt to authenticate using SASL (unknown error)
17/09/18 01:44:01 INFO zookeeper.ClientCnxn: Socket connection established, initiating session, client: /192.168.6.74:63964, server: hadoop41.jiuye/192.168.17.41:2181
17/09/18 01:44:01 INFO zookeeper.ClientCnxn: Session establishment complete on server hadoop41.jiuye/192.168.17.41:2181, sessionid = 0x35e79592f3938b0, negotiated timeout = 90000
17/09/18 01:44:02 INFO query.ConnectionQueryServicesImpl: The stacktrace is being logged for informational purposes to catch clients creating new HConnections. Details: hconnection-0x12d34100 java.lang.Thread.getStackTrace(Unknown Source)
org.apache.phoenix.util.LogUtil.getCallerStackTrace(LogUtil.java:55)
org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:411)
org.apache.phoenix.query.ConnectionQueryServicesImpl.access$400(ConnectionQueryServicesImpl.java:237)
org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2383)
org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2359)
org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)
org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:2359)
org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:255)
org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:149)
org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:221)
org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.openConnection(JDBCDataSource.java:176)
org.jkiss.dbeaver.ext.generic.model.GenericDataSource.openConnection(GenericDataSource.java:125)
org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext.connect(JDBCExecutionContext.java:72)
org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.initializeMainContext(JDBCDataSource.java:115)
org.jkiss.dbeaver.ext.generic.model.GenericDataSource.<init>(GenericDataSource.java:107)
org.jkiss.dbeaver.ext.phoenix.model.PhoenixDataSource.<init>(PhoenixDataSource.java:29)
org.jkiss.dbeaver.ext.phoenix.model.PhoenixMetaModel.createDataSource(PhoenixMetaModel.java:61)
org.jkiss.dbeaver.ext.generic.GenericDataSourceProvider.openDataSource(GenericDataSourceProvider.java:130)
org.jkiss.dbeaver.registry.DataSourceDescriptor.connect(DataSourceDescriptor.java:682)
org.jkiss.dbeaver.runtime.jobs.ConnectJob.run(ConnectJob.java:70)
org.jkiss.dbeaver.runtime.jobs.ConnectJob.runSync(ConnectJob.java:98)
org.jkiss.dbeaver.ui.actions.datasource.DataSourceHandler.connectToDataSource(DataSourceHandler.java:105)
org.jkiss.dbeaver.registry.DataSourceDescriptor.initConnection(DataSourceDescriptor.java:607)
org.jkiss.dbeaver.model.navigator.DBNDataSource.initializeNode(DBNDataSource.java:121)
org.jkiss.dbeaver.model.navigator.DBNDatabaseNode.getChildren(DBNDatabaseNode.java:188)
org.jkiss.dbeaver.model.navigator.DBNDatabaseNode.getChildren(DBNDatabaseNode.java:1)
org.jkiss.dbeaver.ui.navigator.NavigatorUtils.getNodeChildrenFiltered(NavigatorUtils.java:563)
org.jkiss.dbeaver.ui.navigator.database.load.TreeLoadService.evaluate(TreeLoadService.java:49)
org.jkiss.dbeaver.ui.navigator.database.load.TreeLoadService.evaluate(TreeLoadService.java:1)
org.jkiss.dbeaver.ui.LoadingJob.run(LoadingJob.java:86)
org.jkiss.dbeaver.ui.LoadingJob.run(LoadingJob.java:71)
org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:95)
org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
2017-09-18 01:44:14.516 - Can't get column 'IS_GENERATEDCOLUMN': ERROR 504 (42703): Undefined column. columnName=IS_GENERATEDCOLUMN
2017-09-18 01:44:16.367 - null
org.jkiss.dbeaver.model.exec.DBCException: SQL Error [1012] [42M03]: ERROR 1012 (42M03): Table undefined. tableName=DIM_TIME
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:142)
    at org.jkiss.dbeaver.model.impl.jdbc.struct.JDBCTable.readData(JDBCTable.java:181)
    at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:91)
    at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:95)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=DIM_TIME
    at org.apache.phoenix.compile.FromCompiler$BaseColumnResolver.createTableRef(FromCompiler.java:548)
    at org.apache.phoenix.compile.FromCompiler$SingleTableColumnResolver.<init>(FromCompiler.java:374)
    at org.apache.phoenix.compile.FromCompiler.getResolverForQuery(FromCompiler.java:220)
    at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:413)
    at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:394)
    at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:280)
    at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:270)
    at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
    at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:269)
    at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1515)
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:346)
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:139)
    ... 4 more

2.The dbeaver software throw the error, is can't find the own schema:

SQL Error [1012] [42M03]: ERROR 1012 (42M03): Table undefined. tableName=DIM_TIME
  org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=DIM_TIME
serge-rider commented 6 years ago

Thanks for details. No clue so far, something is wrong with the driver but there are no warnings/errors in the log.

What Phoenix driver do you use? IF it is the one which is preconfigured in DBeaver (Maven artifact) then could you try Phoenix client jar from your server distribution? It is usually named phoenix-VERSION-HBase-1.2-client.jar. You can add it in DBeaver driver properties.

Hackeruncle commented 6 years ago

@serge-rider Thanks for quick response. I use the self-compiled phoenix-4.10.0-HBase-1.2-client.jar .

serge-rider commented 6 years ago

Could you try to use prebuilt client driver?

Hackeruncle commented 6 years ago

@serge-rider No, this prebuilt client driver is not related with CDH. So ,I compile the phoenix source code with only supporting the CDH,
there is no change in the core and client module.

And, can you create the schema and create the table with using prebuilt client driver, try it?

CREATE SCHEMA JYDW;
CREATE TABLE JYDW.USERINFO(id bigint not null primary key, name varchar  null,age integer  null, address varchar null) ;
upsert into JYDW.USERINFO(id,name,age,address) values(1,'name1',11,'china1');
SELECT * from JYDW.USERINFO ;    

And I add two parameters with schema.

schema

serge-rider commented 6 years ago

We don't have live Phoenix db in our test env right now. Moving to 4.2.4.

Hackeruncle commented 6 years ago

@serge-rider Thank you very much.

Hackeruncle commented 6 years ago

@serge-rider Thank you very much.

Hackeruncle commented 6 years ago

@serge-rider What can you want to help?

serge-rider commented 6 years ago

@Hackeruncle Basically I need some Phoenix db instance to test on.

Some 3rd party installation or I can give access to our test machine (CentOS 7) for setup.

Hackeruncle commented 6 years ago

@serge-rider Sorry,I'm late.

I have identified that the question is caused by phoenix jdbc jar, and is solved.

serge-rider commented 6 years ago

Thanks for info