Discussions

Expand all | Collapse all

Loading json files into omnisci

  • 1.  Loading json files into omnisci

    Posted 20 days ago
    Hi

    I looked at the data loading options page for OmniSciDB
    https://docs.omnisci.com/latest/6_loading_data.html#copy-from
    I can only see loading "geo" json files as an option? Not sure what that is?
    Is there the capability to automatically load data from a json file such as this directly into a table?  

    {"month": {"0": 6, "1": 6}, "year": {"0": 2019, "1": 2019}, "previousmonth": {"0": 5, "1": 5}, "previousyear": {"0": 2019, "1": 2019}}
    So two row table, with four columns

    Do I need to specify a table structure (create table with all data types for columns) first?
    Cheers

    #Core
    #General
    #Connectors


  • 2.  RE: Loading json files into omnisci

    Posted 20 days ago
    Hi @Michael Kay

    GeoJSON is a specific format for geospatial data: https://geojson.org/​. We support this because it's a specific standard, as opposed to plain JSON, which may or may not be in a record structure. So for your case, we do not import arbitrary JSON directly. If you want your JSON to look like a relational table, you can use something like pandas in Python to read the JSON into a table, then either write the pandas dataframe to CSV or use pymapd to import the data into OmniSci.

    Best,
    Randy Zwitch
    Senior Director of Developer Advocacy | OmniSci


  • 3.  RE: Loading json files into omnisci

    Posted 20 days ago
    Thanks Randy - I will use Pandas as an intermediary as you say
    cheers
    Michael