DataModel
Specifies the data model configuration to use when parsing XML/JSON documents and generating the database metadata. The value supplied here controls how the driver models nested object arrays into tables.
Possible Values
Document, FlattenedDocuments, RelationalData Type
string
Default Value
"Document"
Remarks
The driver splits JSON documents into rows based on the objects nested in arrays. The following subsections describe how that works in each of the three supported configurations. For examples of how to query data in each of the different configurations, see Parsing Hierarchical Data.
Document
Returns a single table representing a row for each top-level object. Nested object arrays that may exist are not flattened, and are returned as aggregates.If you explicitly specify an XPath value, the driver uses that XPath. If you do not, the driver identifies the top-most object array found, and uses that as the XPath.
FlattenedDocuments
Returns a single table representing a JOIN of the available documents in the file. Nested XPath values act in the same manner as a SQL JOIN, and nested sibling XPath values (child paths at the same height), are treated as a SQL CROSS JOIN.If you explicitly identify the XPath values to use, the driver uses those. If you do not, the driver parses the file and identifies the available documents, including nested documents, and uses those as the XPath values.
Relational
Returns multiple tables, one for each XPath value specified. Nested documents (object arrays) are returned as relational tables that contain a primary key and a foreign key that links to the parent table. If you explicitly identify the XPath values to use, the driver uses those. If you do not, the driver parses the file and identifies the available documents, including nested documents, and uses those as the XPath values.
See Also
- XPath: Explicitly sets the paths to the XML documents you want to include.
- FlattenArrays and FlattenObjects: Customizes the columns that will be identified for each of these data models. For examples, see Automatic Schema Discovery.
- Parsing Hierarchical Data: Compares the schemas resulting from different DataModel settings, with example queries.
- For details about the data modeling and flattening techniques available in this driver, see Modeling REST Data.