Search in sources :

Example 1 with FakeSnowflakeBatchServiceImpl

use of org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBatchServiceImpl in project beam by apache.

the class CreateDispositionTest method setupAll.

@BeforeClass
public static void setupAll() {
    PipelineOptionsFactory.register(TestSnowflakePipelineOptions.class);
    options = TestPipeline.testingPipelineOptions().as(TestSnowflakePipelineOptions.class);
    options.setStagingBucketName(BUCKET_NAME);
    options.setServerName("NULL.snowflakecomputing.com");
    stagingBucketName = options.getStagingBucketName();
    storageIntegrationName = options.getStorageIntegrationName();
    snowflakeService = new FakeSnowflakeBatchServiceImpl();
    testData = LongStream.range(0, 100).boxed().collect(Collectors.toList());
    dc = SnowflakeIO.DataSourceConfiguration.create(new FakeSnowflakeBasicDataSource()).withServerName(options.getServerName());
}
Also used : FakeSnowflakeBatchServiceImpl(org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBatchServiceImpl) TestSnowflakePipelineOptions(org.apache.beam.sdk.io.snowflake.test.TestSnowflakePipelineOptions) FakeSnowflakeBasicDataSource(org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBasicDataSource) BeforeClass(org.junit.BeforeClass)

Example 2 with FakeSnowflakeBatchServiceImpl

use of org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBatchServiceImpl in project beam by apache.

the class SchemaDispositionTest method setupAll.

@BeforeClass
public static void setupAll() {
    PipelineOptionsFactory.register(TestSnowflakePipelineOptions.class);
    options = TestPipeline.testingPipelineOptions().as(TestSnowflakePipelineOptions.class);
    options.setStagingBucketName(BUCKET_NAME);
    options.setServerName("NULL.snowflakecomputing.com");
    stagingBucketName = options.getStagingBucketName();
    storageIntegrationName = options.getStorageIntegrationName();
    snowflakeService = new FakeSnowflakeBatchServiceImpl();
    dc = SnowflakeIO.DataSourceConfiguration.create(new FakeSnowflakeBasicDataSource()).withServerName(options.getServerName());
}
Also used : FakeSnowflakeBatchServiceImpl(org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBatchServiceImpl) TestSnowflakePipelineOptions(org.apache.beam.sdk.io.snowflake.test.TestSnowflakePipelineOptions) FakeSnowflakeBasicDataSource(org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBasicDataSource) BeforeClass(org.junit.BeforeClass)

Example 3 with FakeSnowflakeBatchServiceImpl

use of org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBatchServiceImpl in project beam by apache.

the class SnowflakeIOReadTest method setup.

@BeforeClass
public static void setup() {
    List<String> testData = Arrays.asList("Paul,51,red", "Jackson,41,green");
    avroTestData = ImmutableList.of(new AvroGeneratedUser("Paul", 51, "red"), new AvroGeneratedUser("Jackson", 41, "green"));
    FakeSnowflakeDatabase.createTableWithElements(FAKE_TABLE, testData);
    options.setServerName("NULL.snowflakecomputing.com");
    options.setStorageIntegrationName("STORAGE_INTEGRATION");
    options.setStagingBucketName(BUCKET_NAME);
    dataSourceConfiguration = SnowflakeIO.DataSourceConfiguration.create(new FakeSnowflakeBasicDataSource()).withServerName(options.getServerName());
    snowflakeService = new FakeSnowflakeBatchServiceImpl();
}
Also used : FakeSnowflakeBatchServiceImpl(org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBatchServiceImpl) AvroGeneratedUser(org.apache.beam.sdk.io.AvroGeneratedUser) FakeSnowflakeBasicDataSource(org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBasicDataSource) BeforeClass(org.junit.BeforeClass)

Example 4 with FakeSnowflakeBatchServiceImpl

use of org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBatchServiceImpl in project beam by apache.

the class QueryDispositionLocationTest method setupAll.

@BeforeClass
public static void setupAll() {
    PipelineOptionsFactory.register(TestSnowflakePipelineOptions.class);
    options = TestPipeline.testingPipelineOptions().as(TestSnowflakePipelineOptions.class);
    snowflakeService = new FakeSnowflakeBatchServiceImpl();
    testData = LongStream.range(0, 100).boxed().collect(Collectors.toList());
}
Also used : FakeSnowflakeBatchServiceImpl(org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBatchServiceImpl) TestSnowflakePipelineOptions(org.apache.beam.sdk.io.snowflake.test.TestSnowflakePipelineOptions) BeforeClass(org.junit.BeforeClass)

Example 5 with FakeSnowflakeBatchServiceImpl

use of org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBatchServiceImpl in project beam by apache.

the class SnowflakeIOWriteTest method setupAll.

@BeforeClass
public static void setupAll() {
    snowflakeService = new FakeSnowflakeBatchServiceImpl();
    testData = LongStream.range(0, 100).boxed().collect(Collectors.toList());
    testDataInStrings = new ArrayList<>();
    testDataInStrings.add("First row");
    testDataInStrings.add("Second row with 'single' quotation");
    testDataInStrings.add("Second row with single one ' quotation");
    testDataInStrings.add("Second row with single twice '' quotation");
    testDataInStrings.add("Third row with \"double\" quotation");
    testDataInStrings.add("Third row with double one \" quotation");
    testDataInStrings.add("Third row with double twice \"\" quotation");
}
Also used : FakeSnowflakeBatchServiceImpl(org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBatchServiceImpl) BeforeClass(org.junit.BeforeClass)

Aggregations

FakeSnowflakeBatchServiceImpl (org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBatchServiceImpl)5 BeforeClass (org.junit.BeforeClass)5 FakeSnowflakeBasicDataSource (org.apache.beam.sdk.io.snowflake.test.FakeSnowflakeBasicDataSource)3 TestSnowflakePipelineOptions (org.apache.beam.sdk.io.snowflake.test.TestSnowflakePipelineOptions)3 AvroGeneratedUser (org.apache.beam.sdk.io.AvroGeneratedUser)1