use of com.facebook.presto.sql.tree.Use in project presto by prestodb.
the class Console method processSessionParameterChange.
static ClientSession processSessionParameterChange(Object parsedStatement, ClientSession session, Map<String, String> existingProperties, Map<String, String> existingPreparedStatements) {
if (parsedStatement instanceof Use) {
Use use = (Use) parsedStatement;
session = withCatalogAndSchema(session, use.getCatalog().orElse(session.getCatalog()), use.getSchema());
session = withProperties(session, existingProperties);
session = withPreparedStatements(session, existingPreparedStatements);
}
return session;
}
use of com.facebook.presto.sql.tree.Use in project presto by prestodb.
the class TestSqlParser method testUse.
@Test
public void testUse() {
assertStatement("Use test_schema", new Use(Optional.empty(), identifier("test_schema")));
assertStatement("Use test_catalog.test_schema", new Use(Optional.of(identifier("test_catalog")), new Identifier("test_schema")));
assertStatement("Use \"test_schema\"", new Use(Optional.empty(), quotedIdentifier("test_schema")));
assertStatement("Use \"test_catalog\".\"test_schema\"", new Use(Optional.of(quotedIdentifier("test_catalog")), quotedIdentifier("test_schema")));
}
Aggregations