Documentation
¶
Overview ¶
Package urnbuild is the single home of the DataHub dataset URN grammar
urn:li:dataset:(urn:li:dataPlatform:<platform>,<name>,<env>)
It constructs URNs from query-engine table components and decomposes URNs back into platform, name, and environment. Adapters and middleware must build and parse through this package rather than hand-rolling the grammar, so edge cases (commas in dataset names, non-PROD environments) are handled in exactly one place. A repo-level gate (TestDatasetURNGrammarCentralized) fails on new grammar literals outside this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatasetURN ¶
func DatasetURN(platform string, catalogMapping map[string]string, catalog, schema, table string) string
DatasetURN builds a DataHub dataset URN of the form urn:li:dataset:(urn:li:dataPlatform:<platform>,<catalog>.<schema>.<table>,PROD). An empty platform defaults to "trino", and catalogMapping (query-engine catalog to metadata catalog) is applied when it carries the catalog.
func DatasetURNFromName ¶ added in v1.96.0
DatasetURNFromName builds a DataHub dataset URN from an already-joined dataset name. Callers own the name semantics (which components to join, catalog mapping); the grammar lives here. An empty platform defaults to "trino".
Types ¶
type ParsedDataset ¶ added in v1.96.0
type ParsedDataset struct {
// Platform is the data platform segment (e.g. "trino", "s3").
Platform string
// Name is the dataset name segment, verbatim. For table-shaped
// datasets this is <catalog>.<schema>.<table>; for object stores it
// can be <bucket>/<prefix>. Names may legally contain commas.
Name string
// Env is the DataHub fabric/environment segment (e.g. "PROD").
Env string
}
ParsedDataset is the decomposed form of a DataHub dataset URN.
func ParseDatasetURN ¶ added in v1.96.0
func ParseDatasetURN(urn string) (*ParsedDataset, error)
ParseDatasetURN decomposes a DataHub dataset URN. The platform ends at the first comma and the environment starts at the last comma, so dataset names containing commas survive the round trip.