Search in sources :

Example 11 with BeamTableStatistics

use of org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics in project beam by apache.

the class BeamKafkaTableStatisticsTest method testOrderedArrivalMultiplePartitionsRate.

@Test
public void testOrderedArrivalMultiplePartitionsRate() {
    KafkaTestTable table = testTable(3);
    for (int i = 0; i < 100; i++) {
        table.addRecord(createKafkaTestRecord("k" + i, i, 500L * i));
    }
    BeamTableStatistics stats = table.getTableStatistics(null);
    Assert.assertEquals(2d, stats.getRate(), 0.001);
}
Also used : BeamTableStatistics(org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics) Test(org.junit.Test)

Aggregations

BeamTableStatistics (org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics)11 Test (org.junit.Test)10 BeamSqlTable (org.apache.beam.sdk.extensions.sql.meta.BeamSqlTable)3 Table (org.apache.beam.sdk.extensions.sql.meta.Table)3 TableFieldSchema (com.google.api.services.bigquery.model.TableFieldSchema)1 TableRow (com.google.api.services.bigquery.model.TableRow)1 TableSchema (com.google.api.services.bigquery.model.TableSchema)1