Area: Product Issues
Sub-Area: Metadata Tests
Applies to: Cloud
Issue
You create a Metadata Test with a Column Structured Property rule. When you save the test, validation fails with this error:
Failed to validate test definition:
Query schemaFieldStructuredProperties.urn:li:structuredProperty:<property-id> is invalid for entity type dataset: No eligible query evaluator found. Make sure the schemaFieldStructuredProperties is a valid aspect
You Might Be Asking
- Why does my column structured property test fail validation?
- How do I test structured properties on columns in a Metadata Test?
- Which operators work for column structured property rules?
Cause
The test uses the property path schemaFieldStructuredProperties.<property-urn>. The server does not recognize that path, so it rejects the test. The server expects this path:
schemaFields.structuredProperties.<property-urn>
The wrong path comes from one of two places:
- The Metadata Test builder in DataHub Cloud v0.3.x releases writes the wrong path for a Column Structured Property rule.
- A test written in YAML uses the wrong path.
Solution
DataHub Cloud v1.0.0 and later fix the builder. It writes schemaFields.structuredProperties.<property-urn>. If you run a v0.3.x release, contact DataHub Support to upgrade.
If you run v1.0.0 or later and still get this error, your test YAML has the old path. Change schemaFieldStructuredProperties. to schemaFields.structuredProperties. and save the test.
To build the test in the form builder (see Metadata Tests):
- Create a new Metadata Test.
- Select Dataset as the asset type. Column structured property rules only evaluate on datasets.
- In the rules, pick Column-Level Properties > Column Structured Property, then pick your structured property.
- Pick the Exists operator. It is the only operator the builder offers for column structured properties.
The rule passes when at least one column of the dataset has a value for that structured property. It does not check that every column has it. A dataset with no schema fails the rule.
You can also write the test in YAML (switch the builder from Form to YAML). Use the schemaFields.structuredProperties. path, and put conditions inside the on block. The server only reads conditions from inside on. A conditions block at the top level is ignored, so the test (and its actions) would run on every dataset.
This example tags Oracle datasets where no column has the structured property:
on:
types:
- dataset
conditions:
and:
- property: dataPlatformInstance.platform
operator: equals
values:
- 'urn:li:dataPlatform:oracle'
rules:
and:
- property: 'schemaFields.structuredProperties.urn:li:structuredProperty:<your-property-id>'
operator: exists
actions:
failing:
- type: add_tags
values:
- 'urn:li:tag:missing_property'