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.
- Python 3
- PostgreSQL installed and running
- Setup Python Environment:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtInstall PostgreSQL (Mac) if not already installed:
brew install postgresql
brew services start postgresqlNote: You may need to change your postgres password using
ALTER USER postgres WITH PASSWORD 'password';- Setup PostgreSQL Database:
createdb sales
psql -U postgres -d sales -f setup_sales.sqlIf you are prompted for a password and do not know it, run:
psql -U postgres
ALTER USER postgres WITH PASSWORD 'password';
\qAlternatively, you can use your own PostgreSQL username and update the connection settings in the code.
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.