GithubHelp home page GithubHelp logo

abronte / exaltsql Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 14 KB

Easily interop SQL with ruby.

License: MIT License

Ruby 44.02% JavaScript 33.73% CSS 1.60% HTML 20.65%
big-data prestodb ruby sql

exaltsql's People

Contributors

abronte avatar

Watchers

 avatar  avatar

exaltsql's Issues

Cancel job

Need the ability to cancel a current job.

Stream stdout to the client

Should stream any stdout to the web interface so you can have an idea on progress and how things are running.

Job submissions should be asynchronous

Right now when submitting jobs it waits with an open connection until it is done. This should change to submit-then-poll so that longer running jobs do not time out.

CLI interface

Add support to submit jobs via the command line. This is ideal for running jobs on a server on a regular basis or if you prefer your editor locally.

Initial test suite

Need an initial test suite to verify core functionality works

  • job submission
  • check job status

Docker image

Create a docker image for easy development and deployment.

Install as a gem

Make exalt sql installable by a gem. This way you can easily start the web ui or run via command line by requiring the gem.

Production workload

To see if this project can actually be viable, I'd like to implement a production workload I have running in spark.

Goal

Given a list of customer items, determine how many items each customer contributes to an overall unique list of items by customer item count descending.

For example, given 100 unique items, customer A have contributes 20 items to the list, customer B contributes 10 items to the list etc.

Dataset

Table: customer_items

Customer Item
a 0
a 1
a 2
b 0
b 2
b 3
b 5

Code

customer_contributor_counts = []

customers = query("select customer from customer_items group by customer")
unique_items = query("select item from customer_items group by item")
unique_customer_items = query("select customer, item from customer_items group by customer, item")

processed_customers = []

customers.each do |c|
  if customer_contributor_counts.length == 0
    diff_count = query("select count(*) from #{unique_customer_items.table} where customer = #{c["customer"]}").rows[0][0]
  else
     diff_count = query("""
       SELECT
         COUNT(*) AS cnt
       FROM (
         SELECT item FROM #{unique_customer_items.table} WHERE customer = #{c["customer"]}
         EXCEPT
         SELECT item FROM #{unique_customer_items.table} WHERE customer IN (#{processed_customers.join(",")})
        )
     """).rows[0][0]
  end
  customer_contributor_counts << {customer: c["customer"], item_contribution_count: diff_count}
  processed_customers << c["customer"]
end

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.