dengzhhu653 commented on code in PR #5699:
URL: https://github.com/apache/hive/pull/5699#discussion_r2004554051
##########
itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithMiniKdc.java:
##########
@@ -263,6 +264,27 @@ public void testNegativeProxyAuth() throws Exception {
.getConnection(miniHS2.getJdbcURL("default",
";hive.server2.proxy.user=" + MiniHiveKdc.HIVE_TEST_USER_2));
}
+ @Test
+ public void testHs2ThriftMaxMessageSize() throws Exception {
+ HiveConf.setVar(miniHS2.getHiveConf(),
HiveConf.ConfVars.HIVE_THRIFT_CLIENT_MAX_MESSAGE_SIZE, "512");
+ assertEquals(512L,
+ HiveConf.getSizeVar(miniHS2.getHiveConf(),
HiveConf.ConfVars.HIVE_THRIFT_CLIENT_MAX_MESSAGE_SIZE));
+ Connection conn = DriverManager.getConnection(miniHS2.getJdbcURL());
+ Statement stmt = conn.createStatement();
+ try {
+ StringBuilder createTable = new StringBuilder("create external table
tesths2thriftmaxmessagesize(");
+ for (int i = 0; i < 100; i++) {
+ createTable.append("abcdefghijklmnopqrstuvwxyz").append(i).append("
string, ");
+ }
+ createTable.append(" a int)");
+ Throwable t = assertThrows(SQLException.class, () ->
stmt.execute(createTable.toString())).getCause();
+ assertTrue(t instanceof TTransportException);
+ assertEquals(TTransportException.END_OF_FILE,
((TTransportException)t).getType());
Review Comment:
No, this message only shows in HMS side(DEBUG), at client we can see "socket
is closed by peer", the `TTransportException.END_OF_FILE` can tell us there is
a connection problem.
##########
itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithMiniKdc.java:
##########
@@ -263,6 +264,27 @@ public void testNegativeProxyAuth() throws Exception {
.getConnection(miniHS2.getJdbcURL("default",
";hive.server2.proxy.user=" + MiniHiveKdc.HIVE_TEST_USER_2));
}
+ @Test
+ public void testHs2ThriftMaxMessageSize() throws Exception {
+ HiveConf.setVar(miniHS2.getHiveConf(),
HiveConf.ConfVars.HIVE_THRIFT_CLIENT_MAX_MESSAGE_SIZE, "512");
+ assertEquals(512L,
+ HiveConf.getSizeVar(miniHS2.getHiveConf(),
HiveConf.ConfVars.HIVE_THRIFT_CLIENT_MAX_MESSAGE_SIZE));
+ Connection conn = DriverManager.getConnection(miniHS2.getJdbcURL());
+ Statement stmt = conn.createStatement();
+ try {
+ StringBuilder createTable = new StringBuilder("create external table
tesths2thriftmaxmessagesize(");
+ for (int i = 0; i < 100; i++) {
+ createTable.append("abcdefghijklmnopqrstuvwxyz").append(i).append("
string, ");
+ }
+ createTable.append(" a int)");
+ Throwable t = assertThrows(SQLException.class, () ->
stmt.execute(createTable.toString())).getCause();
+ assertTrue(t instanceof TTransportException);
+ assertEquals(TTransportException.END_OF_FILE,
((TTransportException)t).getType());
Review Comment:
No, this message only shows in HMS side(DEBUG), at client we can see "socket
is closed by peer"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]