Jump to content
We've recently updated our Privacy Statement, available here ×
  • Hadoop Hive Sample Reports


    mdahlman
    • Features: Custom Data Sources Product: Hadoop Connectors

    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.

    iReport-dataSource.jpg.e295dc94acd506cd2cf2109e341e8f67.jpg

    iReport-dataSourceConnection.jpg.e57f4026760959c490dc961ed77bd170.jpg

    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.

    iReport-query.jpg.18603e11805ae6c4954410b30128d726.jpg

    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.

     

    iReport-fieldSelection.jpg.f5ea59df9b65367bd8614ef31cc9fe2a.jpg

    After that, you should compile the report by clicking the previiew button. It may take few minutes until the report is generated.

    iReport-reportPreview.jpg.1394093e3a90a96ae1c9a85fe6cab8cd.jpg

    samplereport.pdf

    accounts.csv

    samplereport_0.pdf

    hivesamplereport.jrxml

    hivesamplereport.jasper

    hivesamplereport.zip

    samplereport_1.pdf

    hadoop_hive_report_jrxml.data

    export.zip

    hadoop_hive_report.jrxml


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...