Skip to content

Instantly share code, notes, and snippets.

View MallikarjunaG's full-sized avatar

Mallikarjuna Gandhamsetty MallikarjunaG

  • Infosys Ltd
  • Hyderabad, India
View GitHub Profile

Introduction

This document describes sample process of implementing part of existing Dim_Instance ETL.

I took only Clound Block Storage source to simplify and speedup the process. I also ignnored creation of extended tables (specific for this particular ETL process). Below are code and final thoughts about possible Spark usage as primary ETL tool.

TL;DR

Implementation

Basic ETL implementation is really straightforward. The only real problem (I mean, really problem) is to find correct and comprehensive Mapping document (description what source fields go where).

#!/usr/bin/env python
import sys, os, re
import json
import datetime, iso8601
from pyspark import SparkContext, SparkConf
from pyspark.sql import SparkSession, Row
from pyspark.streaming import StreamingContext
from pyspark.streaming.kafka import KafkaUtils, OffsetRange, TopicAndPartition
@MallikarjunaG
MallikarjunaG / 0_reuse_code.js
Created December 7, 2016 03:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console