Skip to content

Repository files navigation

OLAP-query-processing-engine

Ad-hoc OLAP queries expressed in standard SQL often lead to complex relational algebraic expressions. We provide a framework to allow succinct expression of ad-hoc OLAP queries by extending the group-by statement and adding the new clause, such that, which provides a simple and scalable algorithm to process OLAP queries.

How to Run the Program

Requirements

  • Python 3
  • PostgreSQL installed and running

Setup

  1. Setup Python Environment:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Install PostgreSQL (Mac) if not already installed:

brew install postgresql
brew services start postgresql

Note: You may need to change your postgres password using

ALTER USER postgres WITH PASSWORD 'password';
  1. Setup PostgreSQL Database:
createdb sales
psql -U postgres -d sales -f setup_sales.sql

(Optional) Set PostgreSQL Password

If you are prompted for a password and do not know it, run:

psql -U postgres
ALTER USER postgres WITH PASSWORD 'password';
\q

Alternatively, you can use your own PostgreSQL username and update the connection settings in the code.

Running Queries

Once installation is complete and you are in the virtual environment, to start generating queries run:

python3 engine.py

and follow the prompts. For files, look at the filenames in the example input folder and the input file path will be in the form: example_inputs/{filename} Then run

python3 example_outputs/output{#}.py

to execute the query you created and you will see the results in the terminal.

About

Ad-hoc OLAP queries expressed in standard SQL often lead to complex relational algebraic expressions. We provide a framework to allow succinct expression of ad-hoc OLAP queries by extending the group-by statement and adding the new clause, such that, which provides a simple and scalable algorithm to process queries.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages