USER MANUALS

JSON Sources

Virtual DataPort allows using JSON files as data sources.

To define a JSON data source there are two options to configure the access to the data:

  • Specify the access path to the JSON document (ROUTE clause). The path may include interpolation variables to parameterize the access path depending on the conditions of the query executed at runtime (see more about interpolation variables in the section Execution Context and Interpolation Strings).

  • Specify the access to an Open API document to access its operations (OPENAPI3 clause). The document will be processed automatically in order to create base views of each operation. For more information about the Open API data sources you can see OpenAPI 3 Data Sources FAQ.

To create a JSON data source, use the statement CREATE DATASOURCE JSON.

Syntax of the CREATE DATASOURCE JSON statement
CREATE [ OR REPLACE ] DATASOURCE JSON <name:identifier>
    [ ID = <literal> ]
    [ FOLDER = <literal> ]
    { ROUTE <route> [ CHARSET = <literal> ] [ <route_filters> ]
    | OPENAPI3 (
        DOCUMENT_ACCESS_CONFIGURATION (
           <openapi_route>
        )
        DEFAULT_CONFIGURATION_FOR_BASE_VIEWS (
           ROUTE <route> [ CHARSET = <literal> ] [ <route filters> ]
        )
    )
   }
    [ TRANSFER_RATE_FACTOR = <double> ]
    [ DESCRIPTION = <literal> ]

<route_filters> ::=
  FILTER ( <filter> [, <filter> ]* )

<openapi_route> ::=
   LOCAL <connection class name:literal> <uri:literal>
 | HTTP <connection class name:literal> <uri:literal>
     [ CHECKCERTIFICATES ]
     [ <openapi_authentication> ]

<openapi_authentication> ::=
 AUTHENTICATION {
     OFF
   | BASIC ( <credentials> )
   | DIGEST ( <credentials> )
 }

<credentials> ::= USER <literal> PASSWORD <literal> [ ENCRYPTED ]

To modify a JSON data source, use the statement ALTER DATASOURCE JSON.

Syntax of the ALTER DATASOURCE JSON statement
ALTER DATASOURCE JSON <name:identifier>
    [ ROUTE <route> [ <route_filters> ] ]
    [ OPENAPI3 (
        DOCUMENT_ACCESS_CONFIGURATION (
           <openapi_route>
        )
        DEFAULT_CONFIGURATION_FOR_BASE_VIEWS (
           ROUTE <route> [ CHARSET = <literal> ] [ <route filters> ]
        )
      )
    ]
    [ TRANSFER_RATE_FACTOR = <double> ]
    [ DESCRIPTION = <literal> ]

<route_filters> ::=
  FILTER ( <filter> [, <filter> ]* )

Explanation of some of the parameters of these statements:

  • OR REPLACE: If present and a data source with the same name exists, the current definition is substituted with the new one.

  • DOCUMENT_ACCESS_CONFIGURATION: route configuration to access the OpenAPI Document.

  • DEFAULT_CONFIGURATION_FOR_BASE_VIEWS: default settings to be used by the base views created from the Open API document.

  • TRANSFER_RATE_FACTOR: relative measure of the speed of the network connection between the Denodo server and the data source. Use the default value (e.g. 1 for JDBC databases located on premises) if the data source is accessible through a conventional 100 Mbps LAN. Use higher values for faster networks and lower values for data sources accessible through a WAN.

Add feedback