public final class CatalogModelValidator extends Object
UnifiedCatalogModel against required-field rules, duplicate-name
checks, identifier-bypass detection, and table↔column referential integrity.
Plan §7.1 / §9.6. Identifier-bypass detection rejects models whose names disagree
with IdentifierService.normalize(...) — catching adapters that sneak in a
third-party canonicalization step. Strict-mode escalation is the caller's
responsibility (see CatalogLoadOptions.strict() and §15).
Validation is best-effort: it never throws; every problem is reported as a
CatalogDiagnostic on the returned CatalogValidationResult. ERROR
diagnostics fail validation; WARN/INFO do not.
Duplicate detection uses IdentifierService.areEqual(java.lang.String, java.lang.String, gudusoft.gsqlparser.sqlenv.ESQLDataObjectType) rather than a
normalize-then-Set short-circuit: in dialects where the compare rule is
case-insensitive but the canonical normalize preserves the input spelling
(e.g., BigQuery columns, MySQL columns under lower_case_table_names=2,
MSSQL with a case-insensitive collation), the keyset alone misses real
duplicates. The cost is O(n²) per scope, which is acceptable since each scope
is a single schema or table column list.
| Constructor and Description |
|---|
CatalogModelValidator() |
| Modifier and Type | Method and Description |
|---|---|
CatalogValidationResult |
validate(UnifiedCatalogModel model,
CatalogLoadOptions options) |
public CatalogModelValidator()
public CatalogValidationResult validate(UnifiedCatalogModel model, CatalogLoadOptions options)