@@ -57,19 +57,19 @@ protected static Compression getResultCompression(ClickHouseConfig config) {
5757 CompressionAlgorithm algorithm = CompressionAlgorithm .DEFLATE ;
5858 CompressionLevel level = CompressionLevel .COMPRESSION_MEDIUM ;
5959 switch (config .getDecompressAlgorithmForClientRequest ()) {
60- case NONE :
61- algorithm = CompressionAlgorithm .NO_COMPRESSION ;
62- break ;
63- case DEFLATE :
64- break ;
65- case GZIP :
66- algorithm = CompressionAlgorithm .GZIP ;
67- break ;
68- // case STREAM_GZIP:
69- default :
70- log .warn ("Unsupported algorithm [%s], change to [%s]" , config .getDecompressAlgorithmForClientRequest (),
71- algorithm );
72- break ;
60+ case NONE :
61+ algorithm = CompressionAlgorithm .NO_COMPRESSION ;
62+ break ;
63+ case DEFLATE :
64+ break ;
65+ case GZIP :
66+ algorithm = CompressionAlgorithm .GZIP ;
67+ break ;
68+ // case STREAM_GZIP:
69+ default :
70+ log .warn ("Unsupported algorithm [%s], change to [%s]" , config .getDecompressAlgorithmForClientRequest (),
71+ algorithm );
72+ break ;
7373 }
7474
7575 int l = config .getDecompressLevelForClientRequest ();
@@ -269,7 +269,8 @@ protected CompletableFuture<ClickHouseResponse> executeSync(ClickHouseRequest<?>
269269 sealedRequest .getSettings (), result );
270270
271271 return result .hasException ()
272- ? failedResponse (ClickHouseException .of (result .getException ().getDisplayText (), server ))
272+ ? failedResponse (new ClickHouseException (result .getException ().getCode (),
273+ result .getException ().getDisplayText (), server ))
273274 : CompletableFuture .completedFuture (response );
274275 } catch (IOException e ) {
275276 throw new CompletionException (ClickHouseException .of (e , server ));
0 commit comments