builder.addHeader(PRESTO_CLIENT_INFO, session.getClientInfo()); if (session.getCatalog() != null) { builder.addHeader(PRESTO_CATALOG, session.getCatalog());
try { finalSql = preprocessQuery( Optional.ofNullable(queryRunner.getSession().getCatalog()), Optional.ofNullable(queryRunner.getSession().getSchema()), sql); .withCatalog(query.getSetCatalog().orElse(session.getCatalog())) .withSchema(query.getSetSchema().orElse(session.getSchema())) .build();
try { finalSql = preprocessQuery( Optional.ofNullable(queryRunner.getSession().getCatalog()), Optional.ofNullable(queryRunner.getSession().getSchema()), sql); .withCatalog(query.getSetCatalog().orElse(session.getCatalog())) .withSchema(query.getSetSchema().orElse(session.getSchema())) .build();
for (BenchmarkQuery benchmarkQuery : queries) { session = ClientSession.builder(session) .withCatalog(session.getCatalog()) .withSchema(benchmarkSchema.getName()) .build();
private Builder(ClientSession clientSession) { requireNonNull(clientSession, "clientSession is null"); server = clientSession.getServer(); user = clientSession.getUser(); source = clientSession.getSource(); traceToken = clientSession.getTraceToken(); clientTags = clientSession.getClientTags(); clientInfo = clientSession.getClientInfo(); catalog = clientSession.getCatalog(); schema = clientSession.getSchema(); path = clientSession.getPath(); timeZone = clientSession.getTimeZone(); locale = clientSession.getLocale(); resourceEstimates = clientSession.getResourceEstimates(); properties = clientSession.getProperties(); preparedStatements = clientSession.getPreparedStatements(); roles = clientSession.getRoles(); transactionId = clientSession.getTransactionId(); clientRequestTimeout = clientSession.getClientRequestTimeout(); }