These sample reports are available to help users who are new to Jaspersoft technologies to be able to connect to data in Hadoop.
Loading Sample Data to Hadoop Hive
Copy the data file to HDFS filesystem, change the paths according to your filesystem.
hadoop fs -copyFromLocal $LOCAL_PATH/accounts.csv /user/hdfs
Start hive as hdfs user
sudo -u hdfs hive
Create the table accounts on Hive
CREATE TABLE accounts ( id STRING, date_entered STRING, date_modified STRING, modified_user_id STRING, assigned_user_id STRING, created_by STRING, name STRING, parent_id STRING, account_type STRING, industry STRING, annual_revenue STRING, phone_fax STRING, billing_address_street STRING, billing_address_city STRING, billing_address_state STRING, billing_address_postalcode STRING, billing_address_country STRING, description STRING, rating STRING, phone_office STRING, phone_alternate STRING, email1 STRING, email2 STRING, website STRING, ownership STRING, employees STRING, sic_code STRING, ticker_symbol STRING, shipping_address_street STRING, shipping_address_city STRING, shipping_address_state STRING, shipping_address_postalcode STRING, shipping_address_country STRING, deleted BOOLEAN ) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\;' STORED AS TEXTFILE;
Fill the table with the data stored in accounts.csv
LOAD DATA INPATH '/user/hdfs/accounts.csv' OVERWRITE INTO TABLE accounts;
Running the report in iReport
In order to run the Sample report you will need to create a Hadoop Hive Connection first.
First test the connection to make sure it's working.
Now, you should use Hive SQL to query your Hadoop Hive data source. This is an example that loads all the records from the sample data.
Then, you should choose which fields are you planning to have in your report. You may need all or few fields depending on the report design.
After that, you should compile the report by clicking the previiew button. It may take few minutes until the report is generated.
Log in or register to post comments