Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Apache HoP is not able to connect to Apache Hive #2143

Closed
pradoshsahoo2021 opened this issue Jan 11, 2023 · 6 comments
Closed

[Bug]: Apache HoP is not able to connect to Apache Hive #2143

pradoshsahoo2021 opened this issue Jan 11, 2023 · 6 comments
Assignees
Labels
bug Database P1 Critical Issue
Milestone

Comments

@pradoshsahoo2021
Copy link

Apache Hop version?

2.2.0, 2.1.0

Java version?

openjdk-11.0.2

Operating system

Windows

What happened?

Create a database connection to Apache Hive.
Test the connection. It throws below error.
Error connecting to database [39_UDEX_HIVE] :org.apache.hop.core.exception.HopDatabaseException:
Error occurred while trying to connect to the database

Error connecting to database: (using class org.apache.hive.jdbc.HiveDriver)
Could not open connection to jdbc:hive2:

org.apache.hop.core.exception.HopDatabaseException:
Error occurred while trying to connect to the database

Error connecting to database: (using class org.apache.hive.jdbc.HiveDriver)
Could not open connection to jdbc:hive2:

at org.apache.hop.core.database.Database.normalConnect(Database.java:375)
at org.apache.hop.core.database.Database.connect(Database.java:306)
at org.apache.hop.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:47)
at org.apache.hop.core.database.DatabaseFactory.getConnectionTestResults(DatabaseFactory.java:72)
at org.apache.hop.core.database.DatabaseMeta.testConnectionSuccess(DatabaseMeta.java:2053)
at org.apache.hop.ui.core.database.DatabaseMetaEditor.testConnection(DatabaseMetaEditor.java:857)
at org.apache.hop.ui.core.database.DatabaseMetaEditor.test(DatabaseMetaEditor.java:744)
at org.apache.hop.ui.core.database.DatabaseMetaEditor.lambda$createButtonsForButtonBar$6(DatabaseMetaEditor.java:912)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4251)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4068)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3645)
at org.apache.hop.ui.hopgui.HopGui.open(HopGui.java:464)
at org.apache.hop.ui.hopgui.HopGui.main(HopGui.java:351)

Caused by: org.apache.hop.core.exception.HopDatabaseException:
Error connecting to database: (using class org.apache.hive.jdbc.HiveDriver)
Could not open connection to jdbc:hive2:

at org.apache.hop.core.database.Database.connectUsingClass(Database.java:470)
at org.apache.hop.core.database.Database.normalConnect(Database.java:360)
... 14 more

Caused by: java.sql.SQLException: Could not open connection to jdbc:hive2:
at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:206)
at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:178)
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
at org.apache.hop.core.database.DelegatingDriver.connect(DelegatingDriver.java:45)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)
at org.apache.hop.core.database.Database.connectUsingClass(Database.java:454)
... 15 more
Caused by: io.trino.hive.jdbc.$internal.org.apache.thrift.transport.TTransportException
at io.trino.hive.jdbc.$internal.org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132)
at io.trino.hive.jdbc.$internal.org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
at io.trino.hive.jdbc.$internal.org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:178)
at io.trino.hive.jdbc.$internal.org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:305)
at io.trino.hive.jdbc.$internal.org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:38)
at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:203)
... 21 more

Hostname:
Port:
Database name: default
Url: jdbc:hive2:

Issue Priority

Priority: 1

Issue Component

Component: Database

@hansva
Copy link
Contributor

hansva commented Jan 11, 2023

can you connect to your Hive database using another JDBC tool such as DBeaver?
Have you redacted the hostname and port and was it actually filled in when trying to connect?

@pradoshsahoo2021
Copy link
Author

can you connect to your Hive database using another JDBC tool such as DBeaver? Have you redacted the hostname and port and was it actually filled in when trying to connect?

I am able to connect to Hive from DBeaver and kettle. I also compared the JDBC connection string form Kettle and HOP, both are identical. Still I am getting error when connecting to Hive from Apache Hop.
Note: I am using the same libraries in both Kettle and Hop.

@hansva
Copy link
Contributor

hansva commented Jan 11, 2023

I am using the same libraries in both Kettle and Hop.

Do I have to read this as you made changes to the Hop installation? The drivers needed to connect to Hive are already present in the installation.

@pradoshsahoo2021
Copy link
Author

First I got below error with the existing drivers. After that I replaced them with drivers I am using in kettle and Dbeaver.

Error in the Hop GUI : org/apache/hadoop/shaded/com/ctc/wstx/io/InputBootstrapper

java.lang.NoClassDefFoundError: org/apache/hadoop/shaded/com/ctc/wstx/io/InputBootstrapper

    at org.apache.hadoop.fs.FileSystem.<clinit>(FileSystem.java:206)

    at org.apache.hadoop.hive.conf.valcoersion.JavaIOTmpdirVariableCoercion.<clinit>(JavaIOTmpdirVariableCoercion.java:37)

    at org.apache.hadoop.hive.conf.SystemVariables.<clinit>(SystemVariables.java:37)

    at org.apache.hadoop.hive.conf.HiveConf$ConfVars.<init>(HiveConf.java:5772)

    at org.apache.hadoop.hive.conf.HiveConf$ConfVars.<init>(HiveConf.java:5753)

    at org.apache.hadoop.hive.conf.HiveConf$ConfVars.<clinit>(HiveConf.java:493)

    at org.apache.hive.jdbc.Utils$JdbcConnectionParams.<clinit>(Utils.java:205)

    at org.apache.hive.jdbc.Utils.extractURLComponents(Utils.java:431)

    at org.apache.hive.jdbc.Utils.parseURL(Utils.java:412)

    at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:294)

    at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:282)

    at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:94)

    at org.apache.hop.core.database.DelegatingDriver.connect(DelegatingDriver.java:45)

    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)

    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)

    at org.apache.hop.core.database.Database.connectUsingClass(Database.java:454)

    at org.apache.hop.core.database.Database.normalConnect(Database.java:360)

    at org.apache.hop.core.database.Database.connect(Database.java:306)

    at org.apache.hop.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:47)

    at org.apache.hop.core.database.DatabaseFactory.getConnectionTestResults(DatabaseFactory.java:72)

    at org.apache.hop.core.database.DatabaseMeta.testConnectionSuccess(DatabaseMeta.java:2053)

    at org.apache.hop.ui.core.database.DatabaseMetaEditor.testConnection(DatabaseMetaEditor.java:857)

    at org.apache.hop.ui.core.database.DatabaseMetaEditor.test(DatabaseMetaEditor.java:744)

    at org.apache.hop.ui.core.database.DatabaseMetaEditor.lambda$createButtonsForButtonBar$6(DatabaseMetaEditor.java:912)

    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)

    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4251)

    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)

    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4068)

    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3645)

    at org.apache.hop.ui.hopgui.HopGui.open(HopGui.java:464)

    at org.apache.hop.ui.hopgui.HopGui.main(HopGui.java:351)

Caused by: java.lang.ClassNotFoundException: Unable to load class 'org.apache.hadoop.shaded.com.ctc.wstx.io.InputBootstrapper' in this classloader or in the parent

    at org.apache.hop.core.plugins.HopURLClassLoader.loadClass(HopURLClassLoader.java:96)

    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

    ... 31 more

Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.shaded.com.ctc.wstx.io.InputBootstrapper

    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)

    at org.apache.hop.core.plugins.HopURLClassLoader.loadClassFromThisLoader(HopURLClassLoader.java:66)

    at org.apache.hop.core.plugins.HopURLClassLoader.loadClass(HopURLClassLoader.java:91)

    ... 32 more

Error in the Hop GUI : Could not initialize class org.apache.hive.jdbc.Utils$JdbcConnectionParams

java.lang.NoClassDefFoundError: Could not initialize class org.apache.hive.jdbc.Utils$JdbcConnectionParams

    at org.apache.hive.jdbc.Utils.extractURLComponents(Utils.java:431)

    at org.apache.hive.jdbc.Utils.parseURL(Utils.java:412)

    at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:294)

    at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:282)

    at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:94)

    at org.apache.hop.core.database.DelegatingDriver.connect(DelegatingDriver.java:45)

    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)

    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)

    at org.apache.hop.core.database.Database.connectUsingClass(Database.java:454)

    at org.apache.hop.core.database.Database.normalConnect(Database.java:360)

    at org.apache.hop.core.database.Database.connect(Database.java:306)

    at org.apache.hop.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:47)

    at org.apache.hop.core.database.DatabaseFactory.getConnectionTestResults(DatabaseFactory.java:72)

    at org.apache.hop.core.database.DatabaseMeta.testConnectionSuccess(DatabaseMeta.java:2053)

    at org.apache.hop.ui.core.database.DatabaseMetaEditor.testConnection(DatabaseMetaEditor.java:857)

    at org.apache.hop.ui.core.database.DatabaseMetaEditor.test(DatabaseMetaEditor.java:744)

    at org.apache.hop.ui.core.database.DatabaseMetaEditor.lambda$createButtonsForButtonBar$6(DatabaseMetaEditor.java:912)

    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)

    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4251)

    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)

    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4068)

    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3645)

    at org.apache.hop.ui.hopgui.HopGui.open(HopGui.java:464)

    at org.apache.hop.ui.hopgui.HopGui.main(HopGui.java:351)

@hansva
Copy link
Contributor

hansva commented Jan 12, 2023

thanks for the extra info, will look into it.

@hansva
Copy link
Contributor

hansva commented Jan 12, 2023

.take-issue

@bamaer bamaer self-assigned this Jan 12, 2023
bamaer added a commit to bamaer/hop that referenced this issue Jan 14, 2023
bamaer added a commit to bamaer/hop that referenced this issue Jan 14, 2023
hansva added a commit that referenced this issue Jan 14, 2023
#2143 - hive standalone dependency + integration tests
hansva added a commit to hansva/hop that referenced this issue Jan 26, 2023
@hansva hansva added this to the 2.3 milestone Feb 1, 2023
@hansva hansva closed this as completed Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Database P1 Critical Issue
Projects
None yet
Development

No branches or pull requests

3 participants