Search in sources :

Example 1 with ReadSessionFactory

use of com.google.cloud.teleport.v2.templates.BigQueryToParquet.ReadSessionFactory in project DataflowTemplates by GoogleCloudPlatform.

the class BigQueryToParquetTest method testReadSessionFactoryBadTable.

/**
 * Test {@link ReadSessionFactory} throws exception when invalid table reference is provided.
 */
@Test(expected = IllegalArgumentException.class)
public void testReadSessionFactoryBadTable() {
    // Test input
    final String badTableRef = "fantasmic-999999;great_data.table";
    final TableReadOptions tableReadOptions = TableReadOptions.newBuilder().build();
    ReadSessionFactory trsf = new ReadSessionFactory();
    ReadSession trs = trsf.create(client, badTableRef, tableReadOptions);
}
Also used : ReadSessionFactory(com.google.cloud.teleport.v2.templates.BigQueryToParquet.ReadSessionFactory) ReadSession(com.google.cloud.bigquery.storage.v1beta1.Storage.ReadSession) TableReadOptions(com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions) Test(org.junit.Test)

Aggregations

TableReadOptions (com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions)1 ReadSession (com.google.cloud.bigquery.storage.v1beta1.Storage.ReadSession)1 ReadSessionFactory (com.google.cloud.teleport.v2.templates.BigQueryToParquet.ReadSessionFactory)1 Test (org.junit.Test)1