This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -ne 2 ]; then | |
echo "Please specify Project ID and GCS Bucket Name (without gs:// prefix)" | |
echo "Usage: ./run_on_gcp.sh project-id bucket-name" | |
exit | |
fi | |
export PROJECT=$1 | |
export BUCKET=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dataflow.samples; | |
import java.time.Instant; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.beam.sdk.Pipeline; | |
import org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO; | |
import org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO.Write.Method; | |
import org.apache.beam.sdk.io.TextIO; | |
import org.apache.beam.sdk.options.Default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dataflow.samples; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Set; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.apache.beam.sdk.Pipeline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import logging | |
import apache_beam as beam | |
import apache_beam.transforms.window as window | |
from apache_beam.options.pipeline_options import PipelineOptions | |
from apache_beam.options.pipeline_options import SetupOptions | |
from apache_beam.options.pipeline_options import StandardOptions | |
WINDOW_SECONDS = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dataflow.samples; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.joda.time.Duration; | |
import org.joda.time.Instant; | |
import java.util.concurrent.TimeUnit; | |
import java.util.Date; | |
import java.sql.Timestamp; | |
import org.apache.beam.sdk.Pipeline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse, json, logging, time | |
import apache_beam as beam | |
import apache_beam.transforms.window as window | |
from apache_beam.io import WriteToText | |
from apache_beam.options.pipeline_options import PipelineOptions | |
from apache_beam.options.pipeline_options import SetupOptions | |
class DebugPrinter(beam.DoFn): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse, json, logging, time | |
import apache_beam as beam | |
import apache_beam.transforms.window as window | |
from apache_beam.io import WriteToText | |
from apache_beam.options.pipeline_options import PipelineOptions | |
from apache_beam.options.pipeline_options import SetupOptions | |
class AnalyzeSession(beam.DoFn): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apache-beam[gcp]==2.9.0 | |
inflect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse, logging, time | |
import inflect | |
import apache_beam as beam | |
import apache_beam.transforms.combiners as combine | |
from apache_beam.transforms.userstate import BagStateSpec | |
from apache_beam.coders import VarIntCoder | |
from apache_beam.options.pipeline_options import PipelineOptions | |
from apache_beam.options.pipeline_options import SetupOptions | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dataflow.samples; | |
import java.io.IOException; | |
import java.security.MessageDigest; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.apache.beam.sdk.Pipeline; | |
import org.apache.beam.sdk.values.PCollection; | |
import org.apache.beam.sdk.values.KV; |
OlderNewer