Using Apache Calcite library with Scala example
Example queries are written for foodmart dataset, so please, make sure you have it in your local db before running them.
What's the sum of unit_sales
from the sales_fact_1998
where the Customer's city
is "Albany":
Drill-down query 1
to get the sum of sales by each month
(use the time_by_day
table):
Get the top 5 customer names from "Albany" which have
the highest unit_sales
:
To build and run all integration tests, use the following command:
sbt test
Note: you should have docker
installed on your system
To run example queries locally, use the following command:
sbt run
and then choose a query to run:
Multiple main classes detected, select one to run:
[1] scalcite.example.Query1
[2] scalcite.example.Query2
[3] scalcite.example.Query3
Enter number: ...
Note: before running the queries, please, make sure
that you have the test foodmart
dataset
in your local Postgres DB: https://github.com/OSBI/foodmart-data