Class TestTableUtils


  • public class TestTableUtils
    extends java.lang.Object
    Utility functions for mock classes.
    • Constructor Summary

      Constructors 
      Constructor Description
      TestTableUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.beam.sdk.schemas.Schema buildBeamSqlNullableSchema​(java.lang.Object... args)  
      static org.apache.beam.sdk.schemas.Schema buildBeamSqlSchema​(java.lang.Object... args)
      Create a RowsBuilder with the specified row type info.
      static java.util.List<org.apache.beam.sdk.values.Row> buildRows​(org.apache.beam.sdk.schemas.Schema type, java.util.List<?> rowsValues)
      Convenient way to build a BeamSqlRows.
      static org.apache.beam.sdk.schemas.Schema.Field toNullableRecordField​(java.lang.Object[] args, int i)  
      static org.apache.beam.sdk.schemas.Schema.Field toRecordField​(java.lang.Object[] args, int i)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TestTableUtils

        public TestTableUtils()
    • Method Detail

      • buildBeamSqlSchema

        public static org.apache.beam.sdk.schemas.Schema buildBeamSqlSchema​(java.lang.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 org.apache.beam.sdk.schemas.Schema buildBeamSqlNullableSchema​(java.lang.Object... args)
      • toRecordField

        public static org.apache.beam.sdk.schemas.Schema.Field toRecordField​(java.lang.Object[] args,
                                                                             int i)
      • toNullableRecordField

        public static org.apache.beam.sdk.schemas.Schema.Field toNullableRecordField​(java.lang.Object[] args,
                                                                                     int i)
      • buildRows

        public static java.util.List<org.apache.beam.sdk.values.Row> buildRows​(org.apache.beam.sdk.schemas.Schema type,
                                                                               java.util.List<?> rowsValues)
        Convenient way to build a BeamSqlRows.

        e.g.

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