Search in sources :

Example 26 with Table

use of com.airbnb.airpal.presto.Table in project airpal by airbnb.

the class QueryExecutionAuthorizerTest method testTableReferencesSelectStarSubquery.

@Test
public void testTableReferencesSelectStarSubquery() throws Exception {
    Set<Table> tablesUsed = tablesUsedByQuery(TEST_SELECT_SUBQUERY, defaultConnector, defaultSchema);
    Set<Table> tablesExpected = ImmutableSet.of(new Table(defaultConnector, defaultSchema, "users"), new Table(defaultConnector, "the_gibson", "users"));
    assertEquals(tablesExpected, tablesUsed);
}
Also used : Table(com.airbnb.airpal.presto.Table) Test(org.junit.Test)

Example 27 with Table

use of com.airbnb.airpal.presto.Table in project airpal by airbnb.

the class QueryExecutionAuthorizerTest method testTableReferencesReplaceView.

@Test
public void testTableReferencesReplaceView() throws Exception {
    Set<Table> tablesUsed = tablesUsedByQuery(TEST_REPLACE_VIEW, defaultConnector, defaultSchema);
    Set<Table> tablesExpected = ImmutableSet.of(new Table(defaultConnector, defaultSchema, "users"), new Table(defaultConnector, "the_gibson", "users"));
    assertEquals(tablesExpected, tablesUsed);
}
Also used : Table(com.airbnb.airpal.presto.Table) Test(org.junit.Test)

Example 28 with Table

use of com.airbnb.airpal.presto.Table in project airpal by airbnb.

the class QueryExecutionAuthorizerTest method testTableReferencesSelectUnion.

@Test
public void testTableReferencesSelectUnion() throws Exception {
    Set<Table> tablesUsed = tablesUsedByQuery(TEST_ACCESS_PII_UNION_VIEW, defaultConnector, defaultSchema);
    Set<Table> tablesExpected = ImmutableSet.of(new Table(defaultConnector, defaultSchema, "users"), new Table(defaultConnector, "the_gibson", "users"));
    assertEquals(tablesExpected, tablesUsed);
}
Also used : Table(com.airbnb.airpal.presto.Table) Test(org.junit.Test)

Aggregations

Table (com.airbnb.airpal.presto.Table)28 Test (org.junit.Test)17 ImmutableList (com.google.common.collect.ImmutableList)6 PartitionedTable (com.airbnb.airpal.presto.PartitionedTable)5 Job (com.airbnb.airpal.api.Job)4 GET (javax.ws.rs.GET)4 Column (com.facebook.presto.client.Column)3 List (java.util.List)3 DateTime (org.joda.time.DateTime)3 ArrayList (java.util.ArrayList)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 JobState (com.airbnb.airpal.api.JobState)1 JobFinishedEvent (com.airbnb.airpal.api.event.JobFinishedEvent)1 HiveTablePersistentOutput (com.airbnb.airpal.api.output.HiveTablePersistentOutput)1 InvalidQueryException (com.airbnb.airpal.api.output.InvalidQueryException)1 FileTooLargeException (com.airbnb.airpal.api.output.builders.FileTooLargeException)1 JobOutputBuilder (com.airbnb.airpal.api.output.builders.JobOutputBuilder)1 Persistor (com.airbnb.airpal.api.output.persistors.Persistor)1 ExecutionFailureException (com.airbnb.airpal.core.execution.ExecutionClient.ExecutionFailureException)1