Get view
GET/metalakes/:metalake/catalogs/:catalog/schemas/:schema/views/:view
Return the specified view object
Request
Path Parameters
The name of the metalake
The name of the catalog
The name of the schema
The name of the view
Responses
- 200
- 404
- 5xx
Returns include the view object
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- ViewResponse
Schema
Array [
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
- Literal
- Field
- Function
- PrimitiveType
- StructType
- ListType
- MapType
- UnionType
- UnparsedType
Array [
]
]
Array [
- SQLRepresentation
]
Possible values: [0]
Status code of the response
view
object
The name of the view
The comment of the view
columns
object[]
required
The output columns of the view
The name of the column
type
object
required
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The comment of the column
Default value: true
Whether the column is nullable
defaultValue
object
oneOf
Possible values: [literal]
dataType
object
required
oneOf
string
Possible values: [struct]
fields
object[]
required
The name of the struct field
Default value: true
Whether the struct field is nullable
The comment of the struct field
Possible values: [list]
Default value: true
Whether the list contains null values
Possible values: [map]
Default value: true
Whether the value of the map contains null values
Possible values: [union]
Possible values: [unparsed]
The unparsed type
The string format of the literal value
Possible values: [field]
The name of the field, may be with multiple levels
Possible values: [function]
The name of the function
The arguments of the function
Whether the column is auto increment
representations
object[]
required
The representations of the view, keyed by dialect
oneOf
Possible values: [sql]
The representation type discriminator
The SQL dialect of this representation
The SQL text of the view
The default catalog used to resolve unqualified identifiers in the view representations
The default schema used to resolve unqualified identifiers in the view representations
properties
object
nullable
The properties of the view
audit
object
required
Audit information for a Gravitino resource.
The user who created the resource
The time the resource was created
The user who last modified the resource
The time the resource was last modified
{
"code": 0,
"view": {
"name": "string",
"comment": "string",
"columns": [
{
"name": "string",
"type": [
"boolean",
"byte",
"byte unsigned",
"short",
"short unsigned",
"integer",
"integer unsigned",
"long",
"long unsigned",
"float",
"double",
"decimal(10,2)",
"date",
"time(3)",
"timestamp(3)",
"timestamp_tz(3)",
"string",
"char(10)",
"varchar(10)",
"interval_day",
"interval_year",
"uuid",
"fixed(16)",
"binary"
],
"comment": "string",
"nullable": true,
"defaultValue": {},
"autoIncrement": false
}
],
"representations": [
{}
],
"defaultCatalog": "string",
"defaultSchema": "string",
"properties": {},
"audit": {
"creator": "string",
"createTime": "2024-07-29T15:51:28.071Z",
"lastModifier": "string",
"lastModifiedTime": "2024-07-29T15:51:28.071Z"
}
}
}
{
"code": 0,
"view": {
"name": "view1",
"comment": "This is a view",
"audit": {
"creator": "gravitino",
"createTime": "2024-01-01T00:00:00Z",
"lastModifier": "gravitino",
"lastModifiedTime": "2024-01-01T00:00:00Z"
},
"columns": [
{
"name": "id",
"type": "long",
"comment": "id column",
"nullable": true
}
],
"representations": [
{
"type": "sql",
"dialect": "trino",
"sql": "SELECT id FROM t"
}
],
"properties": {
"key": "value"
}
}
}
Not Found - The target view does not exist
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- NoSuchMetalakeException
- NoSuchCatalogException
- NoSuchSchemaException
- NoSuchViewException
Schema
Possible values: >= 1000 and <= 1100
HTTP response code
Internal type definition of the error
A human-readable message
{
"code": 1002,
"type": "string",
"message": "string",
"stack": [
"string"
]
}
{
"code": 1003,
"type": "NoSuchMetalakeException",
"message": "Failed to operate metalake(s) [test] operation [LOAD], reason [NoSuchMetalakeException]",
"stack": [
"org.apache.gravitino.exceptions.NoSuchMetalakeException: Metalake test does not exist",
"..."
]
}
{
"code": 1003,
"type": "NoSuchCatalogException",
"message": "Failed to operate catalog(s) [test] operation [LOAD] under metalake [my_test_metalake], reason [NoSuchCatalogException]",
"stack": [
"org.apache.gravitino.exceptions.NoSuchCatalogException: Catalog my_test_metalake.test does not exist",
"..."
]
}
{
"code": 1003,
"type": "NoSuchSchemaException",
"message": "Failed to operate schema(s) [my_hive_schema1] operation [LOAD] under catalog [my_hive_catalog], reason [NoSuchSchemaException]",
"stack": [
"org.apache.gravitino.exceptions.NoSuchSchemaException: Hive schema (database) does not exist: my_hive_schema1 in Hive Metastore",
"..."
]
}
{
"code": 1003,
"type": "NoSuchViewException",
"message": "Failed to operate view(s) [test_view] operation [LOAD] under schema [test_schema], reason [NoSuchViewException]",
"stack": [
"org.apache.gravitino.exceptions.NoSuchViewException: View test_view does not exist",
"..."
]
}
A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- Example
Schema
Possible values: >= 1000 and <= 1100
HTTP response code
Internal type definition of the error
A human-readable message
{
"code": 1002,
"type": "string",
"message": "string",
"stack": [
"string"
]
}
{
"code": 1002,
"type": "RuntimeException",
"message": "Internal Server Error",
"stack": [
"java.lang.RuntimeException: Internal Server Error"
]
}