Skip to content

viktor-podzigun/calcite-scala-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status

calcite-scala-example

Using Apache Calcite library with Scala example

How to use it

Example queries are written for foodmart dataset, so please, make sure you have it in your local db before running them.

Query 1

What's the sum of unit_sales from the sales_fact_1998 where the Customer's city is "Albany":

Query1 => tests

Query 2

Drill-down query 1 to get the sum of sales by each month (use the time_by_day table):

Query2 => tests

Query 3

Get the top 5 customer names from "Albany" which have the highest unit_sales:

Query3 => tests

How to build

To build and run all integration tests, use the following command:

sbt test

Note: you should have docker installed on your system

How to run

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

About

Using Apache Calcite library with Scala example

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages