About schemas
- Last UpdatedJun 18, 2024
- 2 minute read
Note: This feature is available in PI Integrator for Business Analytics Advanced Edition.
-
By default, the search shape is used to generate the schema for the streaming messages. You can use this generated schema, or you can import a schema and the shape's data values are assigned to the schema.
Imported schemas
Schemas can be imported from a file or from a schema registry.
-
Schemas imported from a file – Schemas in the following formats can be imported from a file: JavaScript Object Notation (JSON), Comma-separated values (CSV), and Apache Avro. Once imported, you assign values to the properties and edit the properties.
-
Schemas imported from a schema registry – This release supports the Confluent Schema Registry using Apache Avro schemas.
-
Avro schemas imported from the schema registry enforce strict rules. Once imported, the property name and data type are set from the Avro field name and type, respectively, and these cannot be changed. If either of the following is true, then the view will not publish
-
A property is not assigned a value
-
A property has a type mismatch and the corresponding Avro field does not support the null type
-
-
If there is a type mismatch and the Avro field supports the null type, the view publishes but the field is omitted.
Generated schemas
The generated schemas are synched to the asset shape in a nested, flattened, or free-form structure. The schema property names match the asset and attribute names in the shape. The property value is populated with the data values of the related asset or attribute from the shape. In Flattened mode, the schema is displayed in a nonhierarchical structure. In Nested mode, the schema hierarchy is preserved. The Flattened and Nested schemas allow you to change property names, the values associated with the properties, and the data types. You can take a nested or flattened schema and turn it into a free-form schema. The Free-form schema gives you the most flexibility with modifying the schema. In addition to being able to do everything you can with a flattened or nested schema, you can also make changes to the properties by adding, deleting, and reordering properties.