getSchemaByCatalog

语法

getSchemaByCatalog(catalog)

详情

检索指定 catalog 中的所有 schema。

参数

catalog 字符串标量,表示 catalog 的名称。

返回值

一个 Table,包含 schema 的名称(schema)、对应路径(dbUrl)和描述信息(comment)。

例子

设置 schema 描述后,返回表的 comment 列包含对应的描述信息。

catalogName = "securitiesMarketCatalog"
schemaName = "equityMarket"

if (existsCatalog(catalog=catalogName)) {
    dropCatalog(catalog=catalogName)
}

createCatalog(catalog=catalogName)
go
create database securitiesMarketCatalog.equityMarket partitioned by VALUE(1..3)
setSchemaComment(catalog=catalogName, schema=schemaName, comment="沪深股票行情库")
select schema, comment from getSchemaByCatalog(catalog=catalogName)
schema comment
equityMarket 沪深股票行情库

相关函数:getSchemaComment, setSchemaComment