|
23 | 23 | import com.google.common.collect.ImmutableList; |
24 | 24 | import com.google.common.collect.ImmutableMap; |
25 | 25 | import com.google.common.collect.ImmutableSet; |
26 | | -import io.airlift.compress.zstd.ZstdDecompressor; |
| 26 | +import io.airlift.compress.v3.zstd.ZstdDecompressor; |
27 | 27 | import io.airlift.json.JsonCodec; |
28 | 28 | import io.airlift.log.Logger; |
29 | 29 | import io.trino.sql.parser.ParsingException; |
@@ -106,6 +106,7 @@ public class TrinoQueryProperties |
106 | 106 | private boolean isNewQuerySubmission; |
107 | 107 | private Optional<String> errorMessage = Optional.empty(); |
108 | 108 | private Optional<String> queryId = Optional.empty(); |
| 109 | + private final ZstdDecompressor decompressor = ZstdDecompressor.create(); |
109 | 110 |
|
110 | 111 | public static final String TRINO_CATALOG_HEADER_NAME = "X-Trino-Catalog"; |
111 | 112 | public static final String TRINO_SCHEMA_HEADER_NAME = "X-Trino-Schema"; |
@@ -269,8 +270,8 @@ private String decodePreparedStatementFromHeader(String headerValue) |
269 | 270 | String encoded = headerValue.substring(prefix.length()); |
270 | 271 | byte[] compressed = base64Url().decode(encoded); |
271 | 272 |
|
272 | | - byte[] preparedStatement = new byte[toIntExact(ZstdDecompressor.getDecompressedSize(compressed, 0, compressed.length))]; |
273 | | - new ZstdDecompressor().decompress(compressed, 0, compressed.length, preparedStatement, 0, preparedStatement.length); |
| 273 | + byte[] preparedStatement = new byte[toIntExact(decompressor.getDecompressedSize(compressed, 0, compressed.length))]; |
| 274 | + decompressor.decompress(compressed, 0, compressed.length, preparedStatement, 0, preparedStatement.length); |
274 | 275 | return new String(preparedStatement, UTF_8); |
275 | 276 | } |
276 | 277 |
|
|
0 commit comments