You can translate the question and the replies:

Error executing on a Hive Table

I have configured Hive on Denodo 6.0 using following parameters: database adapter: Hive 0.12.0 (Hiveserver2) Driver classpath: 'hive-0.12.0' Driver class: org.apache.hive.jdbc.HiveDriver Database URI: jdbc:hive2://13.82.57.6:10000/default Transaction isolation: Database Default The connection is successful and I am able to fetch Database tables details. I am also able to create Base View on a particular table. It fetches data for the very first time after start of Denodo. When I try to execute the base view for the second time onwards, it gives me below error: Finished with error: Error executing query. Total time 0.015 seconds. BANKRECORD [BASE] [ERROR] BANKRECORD [JDBC WRAPPER] [ERROR] BANKRECORD#0 [JDBC ROUTE] [ERROR] Received exception with message 'org.apache.thrift.transport.TTransportException: java.net.SocketException: Connection reset by peer: socket write error' If I restart Denodo, it will again work once and then start giving above error. I have tested the Hive connection and it is working fine. I have also hit the query from command line on hive and it works perfect there as well. Note: I am not using SSL to connect to the Hive server Please help!! Thanks in advance.
user
06-03-2017 07:06:34 -0500
code

3 Answers

Hi, I tried to connect to Hive database using the same adapter and it works fine for me. I see in your post that the error is java.net.SocketException which is usually caused when the connection is closed or broken. Connection reset by peer means that the other side closed the connection. I would recommend you to try the following: * While creating the datasource, you can configure the “Connection Pool Configurations” by giving the “Initial Size” and “Maximum number of active connections” which will help you to avoid the connection getting closed or broken. You can use the “Ping Query” option where you can configure a test query like ``` select * from <table_name> ``` which will be executed in the datasource to test if a previous connection is still valid. Please remember to check the Test Connections Checkbox. * Also you can try using the updated Hive adapter “Hive 2.0.0(HiveServer2) and see if you face the same error. To know about JDBC connection pool refer the " Virtual DataPort Administration Guide" under the section "JDBC Sources > Connections Pool Configuration" Hope this helps.
Denodo Team
07-03-2017 08:52:41 -0500
code
This exception usually means that you have written to an connection that had already been loses by the peer. In other words, an application protocol error. [Connection reset](http://net-informations.com/java/err/reset.htm) simply means that a TCP RST was received. TCP RST packet is that the remote side telling you the connection on which the previous TCP packet is sent is not recognized, maybe the connection has closed, maybe the port is not open, and something like these. A reset packet is simply one with no payload and with the RST bit set in the TCP header flags. The following are possible causes for the error: * More commonly, it is caused by writing to a connection that the other end has already closed normally. In other words an application protocol error. * It can also be caused by closing a socket when there is unread data in the socket receive buffer. * The TCP (Transmission Control Protocol) socket is closed because the socket received a close command from a remote machine. * Sometimes this can also be due to heavy load causing Server to queue the message and before it can read the message is got timed out at the client end. So you can also check server health and log for excessive load causing this error.
user
08-02-2021 04:18:28 -0500
Hi, Yes, you are correct, the error java.net.SocketException is usually caused when the connection is closed or broken. That is, if the source closed existing connections. The Connection reset means that a TCP RST was received. This happens when your peer receives data that it can't process, and there are various reasons as why this happens. I would perform the following checks in order to find the root cause of this error: * I would check the hive server logs to check for any log related to the connection reset or if there is server load was high. I would also check the **vdp.log** from the **<DENODO_HOME>/logs/vdp** folder for more information on the error thrown in the Virtual DataPort server. * I would also monitor the hive server for any protocol-related issues. * Moreover, when creating the data source in the Virtual DataPort server, I would configure the “[Connection Pool Configurations](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/creating_data_sources_and_base_views/jdbc_sources/jdbc_sources#:~:text=Open%20the-,Connections%20Pool%20Configuration,-dialog%20to%20configure)” by giving the “Initial Size” and “A maximum number of active connections” which would help avoid the connection getting closed or broken. Hope this helps!
Denodo Team
07-11-2021 22:34:11 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here