java.lang.Object
org.apache.beam.sdk.extensions.sql.meta.provider.test.TestTableUtils

public class TestTableUtils extends Object
Utility functions for mock classes.
  • Constructor Details

    • TestTableUtils

      public TestTableUtils()
  • Method Details

    • buildBeamSqlSchema

      public static Schema buildBeamSqlSchema(Object... args)
      Create a RowsBuilder with the specified row type info.

      For example:

      
       TestUtils.RowsBuilder.of(
         Types.INTEGER, "order_id",
         Types.INTEGER, "sum_site_id",
         Types.VARCHAR, "buyer"
       )
       
      Parameters:
      args - pairs of column type and column names.
    • buildBeamSqlNullableSchema

      public static Schema buildBeamSqlNullableSchema(Object... args)
    • toRecordField

      public static Schema.Field toRecordField(Object[] args, int i)
    • toNullableRecordField

      public static Schema.Field toNullableRecordField(Object[] args, int i)
    • buildRows

      public static List<Row> buildRows(Schema type, List<?> rowsValues)
      Convenient way to build a BeamSqlRows.

      e.g.

      
       buildRows(
           schema,
           1, 1, 1, // the first row
           2, 2, 2, // the second row
           ...
       )