From the version 5.2 onwards of Open Source BI Helical Insight, we are directly supporting DuckDB out of the box. Hence the steps mentioned in this blog are not required. In the below image we have highlighted from where you can find out about the current version of your Helical Insight instance.
Connection string looks like below
URL: jdbc:duckdb:C:\Users\Admin\Downloads\duckdb Datasource Name: can be anything Username and Password: Put username and password here. Leave it blank if not applicable
If you are using version older than version 5.2, then only you need to read this blog further in order to make it compatible with DuckDB.
In this blog we will talk connecting Open Source BI product Helical Insight with Duck DB for creating various kind of reports, dashboards and other analytics.
What is Duck DB
DuckDB is a free, open-source, and in-memory analytical database management system (DBMS).DuckDB is an embedded online analytical processing (OLAP). It has been described as the SQLite for analytics. SQLite is a popular solution for RDBMS because it’s embedded, meaning that it has minimal setup required, and you can get started within minutes.
Features of Duck DB
- DuckDB is an embedded solution, so it is super easy to install.
- It has two main forms of data processing systems;
Online Transaction Processing (OLTP) and
Online Analytical Processing (OLAP).
OLTP supports user-facing applications as queries are short and fast,
OLAP is typically used for analyzing massive amounts of data. - They also aim to stay as compatible as possible with the SQL syntax already widely used in the industry, like SQLite, MySQL, and PostgreSQL.
- DuckDB provides ACID properties giving you guarantees on your transactions, so it doesn’t fetch back incorrect results.
- DuckDB runs on a CLI or a Python library, you don’t need any type of management.
Installation of Duck DB
Click below link to download the Duck DbCli Version
https://github.com/duckdb/duckdb/releases/download/v0.9.2/duckdb_cli-windows-amd64.zip
Run the DuckDBapplication to open Cliversion and access
Connect Duck DB to Helical Insight
As Helical Insight is a Java-based open-source business intelligence framework. We required JDBC driver to connect
Download JDBC driver of duck db either from the direct download link here:
https://repo1.maven.org/maven2/org/duckdb/duckdb_jdbc/0.9.2/duckdb_jdbc-0.9.2.jar
OR you can visit Maven and from there you can downlod the latest JAR JDBC drivern file. Click on jar button on files category to download jar file
Now in Helical Insight UI go to Data sources
In list of Data Sources check the required driver if not there go to end and you can see add driver option and click on that
After clicking on that add driver you can see a new tab there
Up on Click on Upload driver and select the downloaded duckdb_jdbc driver
And doing hard of the data sources page you will be able to see the Duckdb driver in Data sources
Now click on that Duckdb driver and give the required details and username and password and Data source name and Test the connection
After getting Connection successful, Save the Datasource. Below we have provided connection details
URL: jdbc:duckdb:C:\Users\Admin\Downloads\duckdb
Datasource Name: can be anything
Username and Password: Put username and password here. Leave it blank if not applicable
Setting Up Configuration Files in Backend:
Helical Insight requires efwd, XML and JS files to access Metadata and Functions of DuckDB
Link: duckdb.zip
1. EFWD FILE:
Path: “..\hi\hi-repository\System\Admin\DbConfig”
Go to this path and add(paste) the downloaded duckdb.efwd file
2. XML and JS files:
Path: “..\hi\hi-repository\System\Admin\SqlFunctions”
Go to this path and paste the add(paste) the duckdb.xml and duckdb.js file
3. Configuring Files:
STEP1: Now we need to map those files with driver class
Path: “..\hi\hi-repository\System\Admin\sqlDialects.properties”
Open sqlDialects.properties and add below text
#DuckDB org.duckdb.DuckDBDriver=org.hibernate.dialect.PostgreSQLDialect
Ex: line no 45,46
add save the file (required administrator access).
4. Now Lets map the driver class with XML function file
Path: “..\hi\hirepository\System\Admin\sqlFunctionsXmlMapping.properties”
Go to the above path and open sqlFunctionsXmlMapping.properties and add below text
#DuckDB org.duckdb.DuckDBDriver=duckdb
Ex:
add save the file (required administrator access).
After completing above steps need to restart the Helical Insight application
Restarting in Windows: By putting “Services.msc” in run bar you can open the list of services.Steps: search ‘Services’ in search bar
Now you can see list of services running find Helical Insight and right click and restart it will few seconds to restart
After restarting you can access Duckdb metadata and functions at report level in Helical Insight. You can create metadata and start creating reports.
In a similar way for restarting Helical Insight service on linux machine,
For Linux , to check the status of the service, run the following command:
service HelicalInsight status
You can restart the service by running the following set of commands:
service HelicalInsight stop
service HelicalInsight start
Please note that all the above commands must be run with sudo permissions.