Giter Site home page Giter Site logo

athena-delta-lake's Introduction

Presentation

This is a very naive Scala implementation of a Athena-DeltaLake connector.

It leverages the power of athena-federated-queries to be able to query DeltaLake tables stored on S3 without having to register those tables on AWS Glue (or any other Metastore).

This project is just intended to be a POC and is not prod-ready !

Install

Requirements

  • SBT
  • Scala 2.12
  • Java 8

Deployment

  • Create Jar:
sbt fetchAthenaSdk assembly
  • Upload Jar on S3
aws s3 cp target/scala-2.12/athena-delta-lake-assembly-0.1.jar <S3_LOCATION>
  • Create an AWS Lambda and specify this Jar as the code source
  • Specify 2 environment variables for this Lambda:
    • spill_bucket a bucket for athena to store temporary data
    • data_bucket the bucket containing your DeltaLake tables
  • Configure Athena to use this Lambda as a DataSource
    • Data Sources > Connect data source > Query a data source > All other data sources > Choose Lambda Function
    • See documentation
  • Select your new Data source
  • Do some queries !

Local run

Launch Lambda locally

Run docker image:

sbt fetchAthenaSdk assemblyPackageDependency
docker build --no-cache -t athenadelta .
docker run -p 9000:8080 --env-file .env athenadelta

Call endpoints

Get Table

curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"@type":"GetTableRequest","identity":{"id":"UNKNOWN","principal":"UNKNOWN","account":"0123456789","arn":"testArn","tags":{},"groups":[]},"queryId":"test-query-id","catalogName":"test-catalog","tableName":{"schemaName":"<MY_SCHEMA>","tableName":"<MY_TABLE>"}}'

Known limitations

  • Only primitives types are handled
  • SHOW PARTITIONS is not working yet
  • Only tables with year/month/day partitionning supported
  • Only one bucket is handled for the moment
  • All databases and tables should be in lower case
  • No predicate pushdown
  • Many things to do... (and add some unit tests)
  • Clean assembly to avoid Jar exceeding the 250 MB Lambda code size limit

athena-delta-lake's People

Contributors

malonsocasas avatar

Stargazers

Daniel Sebban avatar

Watchers

 avatar

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.