Search in sources :

Example 21 with Table

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

the class QueryExecutionAuthorizerTest method testTableReferencesRenameTable2.

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

Example 22 with Table

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

the class QueryExecutionAuthorizerTest method testTableReferencesDropView.

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

Example 23 with Table

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

the class QueryExecutionAuthorizerTest method testTableReferencesDropTable.

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

Example 24 with Table

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

the class QueryExecutionAuthorizerTest method testTableReferencesRenameTable.

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

Example 25 with Table

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

the class QueryExecutionAuthorizerTest method testTableReferencesJoinAlias.

@Test
public void testTableReferencesJoinAlias() throws Exception {
    Set<Table> tablesUsed = tablesUsedByQuery(TEST_SELECT_ALIAS, defaultConnector, defaultSchema);
    Set<Table> tablesExpected = ImmutableSet.of(new Table(defaultConnector, defaultSchema, "users"), new Table(defaultConnector, defaultSchema, "users_pii"));
    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