deephaven_enterprise.schema¶
Module Contents¶
- class Schema(schema)[source]¶
Bases:
deephaven._wrapper.JObjectWrapperWraps a java Schema instance and provides methods for commonly accessed members.
- Parameters:
schema (SchemaLike)
- property column_descriptions: dict[str, str][source]¶
A dictionary of column names to column descriptions. The dictionary may not contain any columns that do not have a description.
- property namespace_set: str[source]¶
The NamespaceSet to which this schema belongs (System or User).
- Return type:
- property table_definition: deephaven.table.TableDefinition[source]¶
The TableDefinition corresponding to this Schema.
- Return type:
- property version: SchemaVersion[source]¶
The SchemaVersion for this schema.
- Return type:
- class SchemaService(schema_service)[source]¶
Bases:
deephaven._wrapper.JObjectWrapperProvides methods for interacting with the system Schema store using a wrapped java SchemaService instance.
- add_schema(schema, code=None, comment=None)[source]¶
Add the specified schema to the service.
- Parameters:
- Return type:
- Returns
the Schema stored in the SchemaService
- all_schemas()[source]¶
Get a list of all known schemas in the system. The latest version of each will be returned.
- Returns
a list of all known schemas.
- contains_namespace(namespace, include_deleted=False)[source]¶
Find out whether the given namespace is known to the schema service.
- contains_schema(namespace, table_name)[source]¶
Find out if the given schema exists. Does not check for deleted schemas.
- create_namespace(namespace_set, namespace, code=None, comment=None)[source]¶
Add a namespace with the given name to the schema service, in the requested NamespaceSet. Returns True if the namespace was added, False if it already exists.
- Parameters:
namespace (str) – The namespace to add
namespace_set (str) – The NamespaceSet (System, User) where the namespace should be created.
code (Optional[str]) – Pass-thru to kv persistence, indicates the code source of this update. Default is None.
comment (Optional[str]) – Pass-thru to kv persistence - a comment for this update. Default is None.
- Returns:
True if the namespace was added, False if it already exists.
- Raises:
DHError if the namespace could not be added to the given NamespaceSet –
- Return type:
- classmethod default()[source]¶
Returns the default SchemaService
- Returns:
the default SchemaService
- Return type:
- delete_schema(namespace, table_name, code=None, comment=None)[source]¶
Delete the specified schema.
- Parameters:
namespace (str) – The namespace of the schema to delete.
table_name (str) – The name of the schema to delete.
code (Optional[str]) – Pass-thru to kv persistence, indicates the code source of this update. Default is None.
comment (Optional[str]) – Pass-thru to kv persistence - a comment for this update. Default is None.
- Raises:
DHError –
- list_all_tables()[source]¶
Get a dictionary of all known tables in all known namespaces for all NamespaceSet values.
- list_namespaces(namespace_set=None, include_deleted=False)[source]¶
Get a list of the namespaces available, optionally limiting to a given NamespaceSet.
- list_table_names(namespace, include_deleted=False)[source]¶
Get a list of all table names in the specified namespace.
- remove_namespace(namespace, code=None, comment=None)[source]¶
Remove the given namespace. The namespace must be empty (contain no schemas).
- Parameters:
- Raises:
DHError if the namespace cannot be removed –
- schema(namespace, table_name)[source]¶
Get the latest version of the Schema defined by namespace and table name.
- Parameters:
- Return type:
Optional[Schema]
- Returns
the latest version of namespace.table_name or None if not found.
- schemas(namespace)[source]¶
Get a list of all known schemas in the given NamespaceSet. The latest version of each will be returned.
- Returns
a list of all known schemas in the given namespace.
- schemas_for_namespace_set(namespace_set)[source]¶
Get a list of all known schemas in the system, with the given NamespaceSet. The latest version of each will be returned.
- Parameters:
namespace_set (str) – The NamespaceSet (System, User) for the schemas.
- Return type:
- Returns
a list of all known schemas in the given NamespaceSet.
- update_schema(schema, code=None, comment=None)[source]¶
Update the schema with the same namespace and table name with the specified new schema.
- Parameters:
- Return type:
- Returns
the Schema stored in the SchemaService
- class SchemaVersion(schema_version)[source]¶
Bases:
deephaven._wrapper.JObjectWrapperImmutable metadata describing the version of a schema, which wraps a SchemaVersion java object.
- property description: str[source]¶
Human readable description of this version. If not specifically defined, will return an empty String.
- Return type:
- property sequence_number: int[source]¶
An integer identifying a single version of a single Schema. Sequence numbers are guaranteed to monotonically increase with each update.
- Return type: