dengzhhu653 commented on code in PR #5699: URL: https://github.com/apache/hive/pull/5699#discussion_r2005641063
########## 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: the payload causes the HMS kill the connection, the client reading from the connection will fail -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org