protected static Map < String , WriteWindowedToBigQuery . FieldInfo < KV < String , Integer > > > configureWindowedTableWrite ( ) { Map < String , WriteWindowedToBigQuery . FieldInfo < KV < String , Integer > > > tableConfigure = new HashMap <> ( ) ; tableConfigure . put ( "team" , new WriteWindowedToBigQuery . FieldInfo <> ( "STRING" , ( c , w ) -> c . element ( ) . getKey ( ) ) ) ; tableConfigure . put ( "total_score" , new WriteWindowedToBigQuery . FieldInfo <> ( "INTEGER" , ( c , w ) -> c . element ( ) . getValue ( ) ) ) ; tableConfigure . put ( "window_start" , new WriteWindowedToBigQuery . FieldInfo <> ( "STRING" , ( c , w ) -> { IntervalWindow window = ( IntervalWindow ) w ; return GameConstants . DATE_TIME_FORMATTER . print ( window . start ( ) ) ; } ) ) ; tableConfigure . put ( "processing_time" , new WriteWindowedToBigQuery . FieldInfo <> ( "STRING" , ( c , w ) -> GameConstants . DATE_TIME_FORMATTER . print ( Instant . now ( ) ) ) ) ; tableConfigure . put ( "timing" , new WriteWindowedToBigQuery . FieldInfo <> ( "STRING" , ( c , w ) -> c . pane ( ) . getTiming ( ) . toString ( ) ) ) ; return tableConfigure ; }
Create a map of information that describes how to write pipeline output to BigQuery . This map is used to write team score sums and includes event timing information .