We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


Loading Issues in Flex Tables — Vertica Forum

Loading Issues in Flex Tables

Hi,

 

I am trying to load flex table with the following data, but unable to do so. Can someone guide me to load this data.

 

Sample Data 1:

{"Floor_result": [{"msg": {"floor_id": "8B5207D8FDB1319AB35A72A32C7E5937","floor_name": "Floor 1","floor_latitude": 0.0,"floor_longitude": 0.0,"floor_img_path": "/download/10.70.120.251/images/7f67cc85-81c7-4e2d-9b95-0f385d0bc4c8.jpg","floor_img_width": 152.0,"floor_img_length": 147.0,"building_id": "659685E876A6325EB3F974FBBBA530F8","floor_level": 1.0,"units": "ft","grid_size": 10.0},"ts": 1461262959}]}

 

Sample Data 2:

{"Location_result": [{"msg": {"sta_eth_mac": {"addr": "7831C1D3B248"},"sta_location_x": 95.952866,"sta_location_y": 42.49939,"error_level": 177,"associated": true,"campus_id": "FCCD5881918E3C8D8628130773403AA6","building_id": "659685E876A6325EB3F974FBBBA530F8","floor_id": "8B5207D8FDB1319AB35A72A32C7E5937","hashed_sta_eth_mac": "3D0BFE66AD058819E3115F960ED62790775D9F5E","loc_algorithm": "ALGORITHM_LOW_DENSITY"},"ts": 1461641473},{"msg": {"sta_eth_mac": {"addr": "442A60AC48D1"},"sta_location_x": 67.8295,"sta_location_y": 121.94821,"error_level": 2,"associated": true,"campus_id": "FCCD5881918E3C8D8628130773403AA6","building_id": "659685E876A6325EB3F974FBBBA530F8","floor_id": "8B5207D8FDB1319AB35A72A32C7E5937","hashed_sta_eth_mac": "8ABB5C0DEF8F4BAB1EB7A980C40F7F383CA52E73","loc_algorithm": "ALGORITHM_LOW_DENSITY"},"ts": 146166349}]}

Comments

  • Hi, so I downloaded your json examples, and this is what worked for me:

     

    create flex table location;

    copy location from '/home/dbadmin/location.dat' PARSER fjsonparser(start_point='msg');

    select compute_flextable_keys('location');

    select build_flextable_view('location');

     

    select * from location_view;
    -[ RECORD 1 ]------+-----------------------------------------
    associated | T
    building_id | 659685E876A6325EB3F974FBBBA530F8
    campus_id | FCCD5881918E3C8D8628130773403AA6
    error_level | 177
    floor_id | 8B5207D8FDB1319AB35A72A32C7E5937
    hashed_sta_eth_mac | 3D0BFE66AD058819E3115F960ED62790775D9F5E
    loc_algorithm | ALGORITHM_LOW_DENSITY
    sta_eth_mac.addr | 7831C1D3B248
    sta_location_x | 95.952866
    sta_location_y | 42.49939

     

    The key is to set the start_point in your json to msg.  This also works for the building data.

     

    Enjoy!

    -Chris

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file