JReport is a embedded BI reporting tool can easily extract and visualize data from the Hortonworks Data Platform 2.3 using the Apache Hive JDBC driver. You can then create reports, dashboards, and data analysis, which can be embedded into your own applications.
In this tutorial we are going to walkthrough the folllowing steps to demonstrate Apache Hive with JReport:
- Install the Apache Hive JDBC driver with JReport.
- Create a new JReport Catalog to manage the Hive connection.
- Use JReport Designer to query the data and create a report.
Step 1: Install the Apache Hive JDBC driver with JReport.
Hive provides standard JDBC connectivity to easily integrate with JReport.
For general instruction to install the Hive JDBC driver see https://hortonworks.com/hadoop/hive/.
- Download Apache Hive JDBC Driver and Hadoop common library.
- Copy the JDBC driver and Hadoop common library in the lib folder
For Windows, copy the JDBC driver jar file into the C:JReportDesignerlib folder.
- Add the file path into the JReport CLASSPATH variable
For Windows, edit the
C:JReportDesignerbinsetenv.batfile, as in Figure 1.
Step 2: Create a new JReport Catalog to manage the Hive connection.
- Click Create New -> Catalog…
- Provide a catalog file name and click “…” to choose the file saving location.
- Click View -> Catalog Browser
- Right click on “Data Source 1” and select “Add JDBC Connection”.
- Enter the “Driver”, “URL”, “User” and “Password”, as in Figure 2.
- Click “OK”, JReport will verify the connection and save all information.
- Add Tables and Views to the JReport Catalog by right-clicking on the connection node and choose “Add Table”. Now you can browse the schemas and add specific tables you wish to make available for building queries, as in Figure 3.
- Click “Done” once you add all necessary tables.
Step 3: Use JReport Designer to query the data and create a report
- In Catalog Browser, right-click on “Queries” and select “Add Query…”.
- Define a JReport Query using the Query Editor, as in Figure 4. You may also import your own SQL statements.
- Click “OK” to close the Query Editor and click the “Save Catalog” button to save your progress to the catalog file.
- Use JReport Designer to query the data and create a report, as shown in Figures 5, 6 and 7.
- Use the chart wizard to add charts to an existing report, as shown in Figures 8 and 9.
Congratulations on creating a report on the Hortonworks Sandbox using JReport! Next, learn how to embed reports and dashboards directly into your own applications.