Documentation

gitHub

What is polymorphism?

Choices

One of the great features of JSON as applicable to NoSQL and Big Data, is the ability to deal with evolving and flexible schemas, both at the level of the general document structure, and at the level of the type of a single field.

This is known as ‘schema combination’, and can be represented in JSON Schema with the use of subschemas and the keywords: anyOf, allOf, oneOf, not

Let's take the example of a field that evolves from being just a string type, to sub-document, or with the co-existence of both field types

Traditional ER tools have a hard time dealing graphically with subschemas, whereas with Hackolade:

Polymorphism

Multiple data types

A simpler form of JSON's flexibility is for a field to have multiple simple types, i.e. a string in some documents and a numeric in others, or boolean, or null.  Hackolade Studio easily deals with that as well.  An example is with Union types in Avro Schema.

 

Combining a null type with a scalar data type (booleanint, longfloatdoublebytes, and string) is very simple, you must click on the + sign to the right of the type property to become:

Multi-type creation

which results in multiple blocks of properties appearing below in the Properties Pane:

Multiple-type block

 

Complex types

If at least one data type is complex (record, enumarray, map, union, or fixed), then you must use a oneOf choice, for example:

Avro oneOf choice