@@ -125,24 +125,27 @@ public void testSelectUInt64() throws SQLException {
125125 @ Test
126126 public void testExternalData () throws SQLException , UnsupportedEncodingException {
127127 ClickHouseStatement stmt = connection .createStatement ();
128- ResultSet rs = stmt .executeQuery (
128+ String [] rows = "21.3.3.14" .equals (connection .getServerVersion ())
129+ ? new String [] { "1\t Group\n " }
130+ : new String [] { "1\t Group" , "1\t Group\n " };
131+
132+ for (String row : rows ) {
133+ try (ResultSet rs = stmt .executeQuery (
129134 "select UserName, GroupName " +
130- "from (select 'User' as UserName, 1 as GroupId) as g" +
131- "any left join groups using GroupId" ,
132- null ,
135+ "from (select 'User' as UserName, 1 as GroupId) as g" +
136+ "any left join groups using GroupId" , null ,
133137 Collections .singletonList (new ClickHouseExternalData (
134138 "groups" ,
135- new ByteArrayInputStream ("1\t Group" .getBytes ())
136- ).withStructure ("GroupId UInt8, GroupName String" ))
137- );
138-
139- rs .next ();
140-
141- String userName = rs .getString ("UserName" );
142- String groupName = rs .getString ("GroupName" );
143-
144- Assert .assertEquals (userName , "User" );
145- Assert .assertEquals (groupName , "Group" );
139+ new ByteArrayInputStream (row .getBytes ())
140+ ).withStructure ("GroupId UInt8, GroupName String" )))) {
141+ Assert .assertTrue (rs .next ());
142+ String userName = rs .getString ("UserName" );
143+ String groupName = rs .getString ("GroupName" );
144+
145+ Assert .assertEquals (userName , "User" );
146+ Assert .assertEquals (groupName , "Group" );
147+ }
148+ }
146149 }
147150
148151
@@ -176,6 +179,10 @@ public int read() {
176179
177180 @ Test
178181 public void testExternalDataStream () throws SQLException , UnsupportedEncodingException {
182+ if ("21.3.3.14" .equals (connection .getServerVersion ())) {
183+ return ;
184+ }
185+
179186 final ClickHouseStatement statement = connection .createStatement ();
180187 statement .execute ("DROP TABLE IF EXISTS test.testExternalData" );
181188 statement .execute (
0 commit comments