In our earlier articles, we have talked about how to connect single datasource using Helical Insight. This article talks about how to connect multiple datasources using Helical Insight v1.0.1 .In this case we have referred CSV and MySQL as a datasources.
Steps:
-
- Create a folder inside HI Repository. In this case, we have created a folder named “MySQL CSV datasource”.
C:\Helical Insight\hi-repository\MySQL CSV datasource
- Create a folder inside HI Repository. In this case, we have created a folder named “MySQL CSV datasource”.
-
- Inside this folder create another folder and save the CSV inside it. In this case, we have created a folder named “CSV”.
C:\Helical Insight\hi-repository\MySQL CSV datasoure\CSV
- Place the CSV which you intend to use in this folder. Please make sure that the CSV which you are putting is having datatype defined in the header.
-
Datatype format to use in a CSV :
Column_Name : Datatype_Name
For example, refer to the below in which datatype has been added into the header of CSV.
- Inside this folder create another folder and save the CSV inside it. In this case, we have created a folder named “CSV”.
Column:Dataytpe | Column:Dataytpe | Column:Dataytpe |
---|---|---|
Client :string | Vendor:string | Reason:string |
Timeline:date | FollowUP:date | Meeting_Agenda:string |
Meeting_Impact:string | Owner:string | DoJ:date |
Status:string | Journey_Type:string | Cancellation_Reason:string |
Travel_Type:string | Source:string | Cancellation:string |
Destination:string | Cost:double | Age:int |
MOP:string | Ticket_by:string | Travelled_by:string |
-
- After that create a MySQL-CSV-Model JSON file.
inline: { version: '1.0', defaultSchema: 'MySQL CSV', schemas: [ { name: 'Travel csv', type: 'custom', factory: 'org.apache.calcite.adapter.csv.CsvSchemaFactory', operand: { directory: 'C:/Helical Insight/hi-repository/MySQL CSV datasource' } }, { name: 'Sample Mysql', type: 'custom', factory: 'org.apache.calcite.adapter.jdbc.JdbcSchema$Factory', operand: { jdbcDriver: 'com.mysql.jdbc.Driver', jdbcUrl: 'jdbc:mysql://localhost:3307/SampleTravelData?connectTimeout=10000', jdbcUser: 'hiuser', jdbcPassword: 'hiuser' } } ] }
We can enlist as many datasources over here as we want. Since we want to use CSV with MySQL and join them and do certain analysis, two of them have been defined.
-
- After that create an EFWD (database connection file) file in
C:\Helical Insight\hi-repository\MySQL CSV Datasource
<EFWD> <DataSources> <Connection id="1" name="MySQL CSV Datasource" type="sql.calcite"> <model>MySQL CSV datasource/csv-model.json</model> <driverName>org.apache.calcite.jdbc.Driver</driverName> </Connection> </DataSources> </EFWD>
- After that create an EFWD (database connection file) file in
- Once the EFWD file is created it will start listing in the Virtual Data Source listing.
Following are the steps to create Report using created Datasource :
-
- Go to Metadata
-
- Select Datasource Type. In this case datasource type is “Virtual Datasource”.
-
- Select the datasource
-
- Select the Schemas from the list and then click “Next”. Schemas contain the list of databases.
-
- Select the required table from the list which will be used for reporting purpose and then click “Next”.
-
- Now, select the required columns from the list and then click “Next”. Here, columns will be displayed based on the table selection.
- After clicking “Next” a metadata view page will be displayed. In a metadata mode various activities includes such as Table/Column Aliasing, define joins, define views and apply metadata security on table/column.
- Now, define required joins/views between the tables and then click Save.
-
Thus, users can now go to the ad-hoc report interface, connect to this above created metadata and create reports.
For further assistance, kindly contact us on support@helicalinsight.com or post your queries at forum.helicalinsight.com