deniskuzZ commented on code in PR #5699: URL: https://github.com/apache/hive/pull/5699#discussion_r2005670413
########## 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: my point is that returned exception doesn't give a clue what is the problem - you need to go and check HMS logs. Is that hard to propagate the root cause to a client? ########## 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: my point is that returned exception doesn't give a clue what is the problem - you need to go and check HMS logs. Is that hard to propagate the root cause to a client? -- 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