Skip to main content

DESCRIBE

Deprecated version

This document refers to a deprecated version of the RQL programming language.

Please go here for documentation related to the latest supported version.

Describes how RAW inferred data from a location. Fails with a runtime error if the location is not accessible or is not a database table or a file.

Syntax
DESCRIBE(location)

Location must be one of the supported location types: refer to :ref:locations for the URL syntax supported.

The output is a record with the following fields:

  • description (type: string): Description of the data format of the location, e.g.:
    "csv with encoding utf-8", 
    "oracle table url='oracle:server1/schema/table'"
  • type (type: string): Complete output type of the location, e.g.:
    """collection(record(a: string nullable, b: int))"""
  • properties (type: collection(record(name: string, value: string))): List of key-value pairs of extra properties of the location, e.g.:
    [
    (name: "delimiter", value: ","),
    (name: "has_header", value: "true")
    ]
  • is_collection (type: bool): True if the top-level type is a collection, false otherwise.
  • columns (type: collection(record(col_name: string nullable, type: string, nullable: bool))): Description of the type of the columns of this location, e.g.:
    [
    (col_name: "a", type: "string", nullable: true),
    (col_name: "b", type: "int", nullable: false)
    ]
  • sampled (type: bool): Shows if the location was sampled or read completely for inference.

For example, assume a file "data.csv" with the following content:

"name", "age"
"John", 39
"Jane", 37

the following query:

DESCRIBE("file://data.csv")

will yield the following result:

RECORD(
description: "csv with encoding utf-8 (confidence: 60%)",
`type`: "collection(record(`name`: string,`age`: int))",
isCollection: true,
columns: [
(col_name: "name", `type`: "string", nullable: false),
(col_name: "age", `type`: "int", nullable: false)
],
properties : [
(name: "delimiter", value: ","),
(name: "has_header", value: "true"),
]
)
info

For data types which are not records or collections of records the columns field will have only one row with the col_name field set to null