Created
November 15, 2019 13:47
-
-
Save juri96/66ef149b2d1d5bb95bb25b6cbad387e6 to your computer and use it in GitHub Desktop.
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
val resultTableSpec = TableReference() | |
.apply { | |
projectId = "GCP_PROJECT_NAME" | |
datasetId = "BIGQUERY_DATASET_NAME" | |
tableId = "BIGQUERY_TABLE_NAME" | |
} | |
pipeline | |
.apply("Read files", TextIO.read().from("gs://BUCKET_NAME/*.csv")) | |
.apply("Filter headers", PipelineSteps.filterHeaderRow()) | |
.apply("Split lines", PipelineSteps.splitCsvLine()) | |
.apply("Map to entity", PipelineSteps.mapElementsToEntity()) | |
.apply("Map to table row", PipelineSteps.mapEntityToTableRow()) | |
.apply("Write to BigQuery", PipelineSteps.writeToBigQuery(resultTableSpec)) | |
pipeline.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment