Skip to content

Instantly share code, notes, and snippets.

View datancoffee's full-sized avatar

Serhii Sokolenko datancoffee

View GitHub Profile
@howarddierking
howarddierking / CsvShredder.java
Created December 6, 2017 17:20
Sample ParDo transformation for shredding CSV files into a map
package com.howarddierking.demo;
import org.apache.beam.sdk.io.FileSystems;
import org.apache.beam.sdk.io.fs.ResourceId;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
import org.apache.commons.io.FilenameUtils;
@savelee
savelee / Array.sql
Created February 22, 2017 09:43
BigQuery Array Struct example
#standardSQL
#Top two Hacker News articles by day
WITH TitlesAndScores AS (
SELECT
ARRAY_AGG(STRUCT(title,
score)) AS titles,
EXTRACT(DATE
FROM
time_ts) AS date
FROM