Code Monkey home page Code Monkey logo

spark-etl's People

Contributors

instanceofme avatar jfyuen avatar jobar avatar parisni avatar rsareth avatar saadoone avatar tiko972 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

spark-etl's Issues

Store input csv to hdfs

Right now the csv is only written locally.
It should go into hdfs by default and locally if prefixed with "file://"

There might be good ideas in the sqoop direct import in particular the PostgresqlAsyncSink class

Optionally add a hash column

This will add a new column that calculate the hash of the columns.

A function would have :

  • dataframe
  • hashColumnName
  • column not to hash[]

Make imports be parallel

By splitting a table in multiple query from multiple executors
this will speedup the data retrieval. Steps are:

  1. get min/max
  2. setup multiple executor
  3. run multiple COPY FROM

spark-postgress class not found error

when we try to use this tool following instructions from readme, I am getting
java.lang.ClassNotFoundException: org.apache.spark.internal.Logging$class Is there any way to fix this ?

Add "reindex" argument

Allow deindexing before large bulk load and reindex the table afterward

  • Deindex
UPDATE pg_index 
SET indisready=false 
WHERE indrelid IN (
SELECT pg_class.oid FROM pg_class
JOIN pg_catalog.pg_namespace n ON n.oid = pg_class.relnamespace
WHERE relname='theTable' and nspname = 'theSchema'
);
  • Insert
  • Reindex
UPDATE pg_index 
SET indisready=true 
WHERE indrelid IN (
SELECT pg_class.oid FROM pg_class
JOIN pg_catalog.pg_namespace n ON n.oid = pg_class.relnamespace
WHERE relname='theTable' and nspname = 'theSchema'
);
REINDEX TABLE theSchema.theTable;

Provide both parallell level and partitions for inputBulk

Parallel level would be the number of concurrent postgres connection
while
partitions would be the resulting number of csv in hdfs.

This will be useful in case of large multiline csv, because they will be splitted into multiple
small csv instead of few large ones.

Add spark backed scd 1

goal is to let spark distinguish the changes, insert new rows, and update different rows. Steps are:

  1. fetch both ID and HASH from the entire target table to spark
  2. compare ID and HASH from target table and source table:
    1. create new rows
    2. create rows to update
  3. insert new rows directly
  4. insert rows to update in a temp table, and update

This way limits the postgresql computation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.