Package com.facebook.presto.sql.analyzer

Examples of com.facebook.presto.sql.analyzer.Session


        return evaluate(parsedExpression);
    }

    private static Object evaluate(Expression expression)
    {
        ExpressionInterpreter interpreter = ExpressionInterpreter.expressionInterpreter(expression, DUAL_METADATA_MANAGER, new Session("user", "test", DEFAULT_CATALOG, DEFAULT_SCHEMA, null, null));

        return interpreter.evaluate((RecordCursor) null);
    }
View Full Code Here


        }
        InterpretedProjectionFunction projectionFunction = new InterpretedProjectionFunction(outputType,
                expression,
                symbolToInputMappings,
                DUAL_METADATA_MANAGER,
                new Session("user", "test", Session.DEFAULT_CATALOG, Session.DEFAULT_SCHEMA, null, null)
        );

        // create output
        BlockBuilder builder = new BlockBuilder(new TupleInfo(outputType.getRawType()));
View Full Code Here

        assertRequest(!isNullOrEmpty(catalog), "Catalog (%s) is empty", PRESTO_CATALOG);
        assertRequest(!isNullOrEmpty(schema), "Schema (%s) is empty", PRESTO_SCHEMA);

        String remoteUserAddress = requestContext.getRemoteAddr();

        Session session = new Session(user, source, catalog, schema, remoteUserAddress, userAgent);
        ExchangeClient exchangeClient = exchangeClientSupplier.get();
        Query query = new Query(session, statement, queryManager, exchangeClient);
        queries.put(query.getQueryId(), query);
        return Response.ok(query.getNextResults(uriInfo, new Duration(1, TimeUnit.MILLISECONDS))).build();
    }
View Full Code Here

        checkArgument(!query.isEmpty(), "query is empty");
        checkNotNull(catalog, "catalog is null");
        checkNotNull(schema, "schema is null");

        String remoteUserAddress = requestContext.getRemoteAddr();
        QueryInfo queryInfo = queryManager.createQuery(new Session(user, source, catalog, schema, remoteUserAddress, userAgent), query);
        URI pagesUri = uriBuilderFrom(uriInfo.getRequestUri()).appendPath(queryInfo.getQueryId().toString()).build();
        return Response.created(pagesUri).entity(queryInfo).build();
    }
View Full Code Here

    @BeforeMethod
    public void setUp()
    {
        executor = newCachedThreadPool(daemonThreadsNamed("test"));
        Session session = new Session("user", "source", "catalog", "schema", "address", "agent");
        taskContext = new TaskContext(new TaskId("query", "stage", "task"), executor, session);
    }
View Full Code Here

    @Test(expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = "Task exceeded max memory size.*")
    public void testMemoryLimit()
            throws Exception
    {
        Session session = new Session("user", "source", "catalog", "schema", "address", "agent");
        DriverContext driverContext = new TaskContext(new TaskId("query", "stage", "task"), executor, session, new DataSize(100, BYTE))
                .addPipelineContext(true, true)
                .addDriverContext();

        OperatorContext operatorContext = driverContext.addOperatorContext(0, StaticOperator.class.getSimpleName());
View Full Code Here

        });
        executor = newCachedThreadPool(daemonThreadsNamed("test-%s"));

        httpClient = new TestingHttpClient(new HttpClientHandler(), executor);

        Session session = new Session("user", "source", "catalog", "schema", "address", "agent");
        driverContext = new TaskContext(new TaskId("query", "stage", "task"), executor, session)
                .addPipelineContext(true, true)
                .addDriverContext();

        exchangeClientSupplier = new Supplier<ExchangeClient>()
View Full Code Here

        return ImmutableList.copyOf(drivers);
    }

    public static LocalQueryRunner createDualLocalQueryRunner(ExecutorService executor)
    {
        return createDualLocalQueryRunner(new Session("user", "test", DEFAULT_CATALOG, DEFAULT_SCHEMA, null, null), executor);
    }
View Full Code Here

        return new LocalQueryRunner(metadataManager, splitManager, dataStreamManager, MockLocalStorageManager.createMockLocalStorageManager(), session, executor);
    }

    public static LocalQueryRunner createTpchLocalQueryRunner(ExecutorService executor)
    {
        return createTpchLocalQueryRunner(new Session("user", "test", TPCH_CATALOG_NAME, TPCH_SCHEMA_NAME, null, null), executor);
    }
View Full Code Here

        return createTpchLocalQueryRunner(session, new InMemoryTpchBlocksProvider(), executor);
    }

    public static LocalQueryRunner createTpchLocalQueryRunner(TpchBlocksProvider tpchBlocksProvider, ExecutorService executor)
    {
        return createTpchLocalQueryRunner(new Session("user", "test", TPCH_CATALOG_NAME, TPCH_SCHEMA_NAME, null, null), tpchBlocksProvider, executor);
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.sql.analyzer.Session

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.