Source:
private Request buildQueryRequest(ClientSession session, String query) { HttpUrl url = HttpUrl.get(session.getServer()); if (url == null) { throw new ClientException("Invalid server URL: " + session.getServer()); } url = url.newBuilder().encodedPath("/v1/statement").build(); Request.Builder builder = prepareRequest(url) .post(RequestBody.create(MEDIA_TYPE_JSON, query)); if (session.getSource() != null) { builder.addHeader(PRESTO_SOURCE, session.getSource()); } if (session.getSource() != null) { builder.addHeader(PRESTO_CLIENT_TAGS, Joiner.on(",").join(session.getClientTags())); } if (session.getClientInfo() != null) { builder.addHeader(PRESTO_CLIENT_INFO, session.getClientInfo()); } if (session.getCatalog() != null) { builder.addHeader(PRESTO_CATALOG, session.getCatalog()); } if (session.getSchema() != null) { builder.addHeader(PRESTO_SCHEMA, session.getSchema()); } builder.addHeader(PRESTO_TIME_ZONE, session.getTimeZone().getId()); if (session.getLocale() != null) { builder.addHeader(PRESTO_LANGUAGE, session.getLocale().toLanguageTag()); } Map<String, String> property = session.getProperties(); for (Entry<String, String> entry : property.entrySet()) { builder.addHeader(PRESTO_SESSION, entry.getKey() + "=" + entry.getValue()); } Map<String, String> statements = session.getPreparedStatements(); for (Entry<String, String> entry : statements.entrySet()) { builder.addHeader(PRESTO_PREPARED_STATEMENT, urlEncode(entry.getKey()) + "=" + urlEncode(entry.getValue())); } builder.addHeader(PRESTO_TRANSACTION_ID, session.getTransactionId() == null ? "NONE" : session.getTransactionId()); return builder.build(); }

Target:
private Request buildQueryRequest(ClientSession session, String query) { HttpUrl url = HttpUrl.get(session.getServer()); if (url == null) { throw new ClientException("Invalid server URL: " + session.getServer()); } url = url.newBuilder().encodedPath("/v1/statement").build(); Request.Builder builder = prepareRequest(url) .post(RequestBody.create(MEDIA_TYPE_JSON, query)); if (session.getSource() != null) { builder.addHeader(PRESTO_SOURCE, session.getSource()); } if (session.getClientTags() != null && !session.getClientTags().isEmpty()) { builder.addHeader(PRESTO_CLIENT_TAGS, Joiner.on(",").join(session.getClientTags())); } if (session.getClientInfo() != null) { builder.addHeader(PRESTO_CLIENT_INFO, session.getClientInfo()); } if (session.getCatalog() != null) { builder.addHeader(PRESTO_CATALOG, session.getCatalog()); } if (session.getSchema() != null) { builder.addHeader(PRESTO_SCHEMA, session.getSchema()); } builder.addHeader(PRESTO_TIME_ZONE, session.getTimeZone().getId()); if (session.getLocale() != null) { builder.addHeader(PRESTO_LANGUAGE, session.getLocale().toLanguageTag()); } Map<String, String> property = session.getProperties(); for (Entry<String, String> entry : property.entrySet()) { builder.addHeader(PRESTO_SESSION, entry.getKey() + "=" + entry.getValue()); } Map<String, String> statements = session.getPreparedStatements(); for (Entry<String, String> entry : statements.entrySet()) { builder.addHeader(PRESTO_PREPARED_STATEMENT, urlEncode(entry.getKey()) + "=" + urlEncode(entry.getValue())); } builder.addHeader(PRESTO_TRANSACTION_ID, session.getTransactionId() == null ? "NONE" : session.getTransactionId()); return builder.build(); }