Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Denodo is a powerful data virtualization platform that provides its users with a JSON format of query results that are accessed through its REST API. We seek to provide users with the Denodo JSON format in an effort to allow them to quickly integrate RDS output into existing applications designed to work against the Denodo JSON format. The only difference is that users can still include our metadata if desired using the metadata parameter.

Step By Step

  • In this example we will assume we have a collection "test" and view "view" created with the variables "salary","category", and "weight".
  • A standard query would look like this:

    Code Block
    titleStandard Select
     http://localhost:8080/rds/catalog/test/testStats/select
    Code Block
    titleStandard Select Output
    {
        "records": [
            [
                10000,
                1,
                0.2
            ],
            [
                20000,
                2,
                0.5
            ],
            [
                152666,
                2,
                0.75
            ]
        ],
        "info": {
            "colOffset": 0,
            "colCount": 3,
            "moreCols": false,
            "format": "MTNA",
            "includeMetadata": false,
            "limit": 20,
            "offset": 0,
            "moreRows": false
        }
    }
  • By adding the format parameter we can get this output in Denodo's format.

    Code Block
    titleDenodo Select
     http://localhost:8080/rds/catalog/test/testStats/select?format=denodo
    Code Block
    titleDenodo Output
    {
        "name": "",
        "elements": [
            {
                "salary": 10000,
                "category": 1,
                "weight": 0.2
            },
            {
                "salary": 20000,
                "category": 2,
                "weight": 0.5
            },
            {
                "salary": 152666,
                "category": 2,
                "weight": 0.75
            }
        ],
        "links": []
    }
  • In addition to the Denodo format, users can also include the MTNA metadata section if desired.

    Code Block
    titleDenodo Select With Metadata
     http://localhost:8080/rds/catalog/test/testStats/select?format=denodo&metadata
    Code Block
    titleDenodo Output With Metadata
    {
        "name": "",
        "metadata": {
            "variables": {
                "resources": [
                    {
                        "id": "salary",
                        "name": "salary",
                        "index": 1,
                        "storageType": "NUMERIC",
                        "displayType": "NUMERIC",
                        "width": 12
                    },
                    {
                        "id": "category",
                        "name": "category",
                        "index": 2,
                        "storageType": "NUMERIC",
                        "displayType": "NUMERIC",
                        "width": 10
                    },
                    {
                        "id": "weight",
                        "name": "weight",
                        "index": 3,
                        "storageType": "NUMERIC",
                        "displayType": "NUMERIC",
                        "width": 12
                    }
                ],
                "info": {
                    "offset": 0,
                    "more": false,
                    "count": 3
                }
            }
        },
        "elements": [
            {
                "salary": 10000,
                "category": 1,
                "weight": 0.2
            },
            {
                "salary": 20000,
                "category": 2,
                "weight": 0.5
            },
            {
                "salary": 152666,
                "category": 2,
                "weight": 0.75
            }
        ],
        "links": []
    }