A dynamic reflective calcite adapter for map lists.
It contains calcite related classes to make Map<String, List < Map<String, ?> >
a SQL queryable schema, Map keys are mapped to table names, each List is mapped to a table, each inner map objec is mapped to a row, whith keys are mapped to columns names.
For more details about Calcite, see the home page.
calcite-json-adapter can only query the first level sub-objects of the inner map, and only sub-objects of the following Java classes can be mapped to columns,sub-objects of other JAVA type will be ignored.
String (mapped as VARCHAR) Long (mapped as BIGINT) Boolean (mapped as BOOLEAN) Integer (mapped as INT) BigDecimal (mapped as DECIMAL) Double (mapped as FLOAT) Float (mapped as REAL) LocalDate (mapped as DATE) LocalTime (mapped as TIME) LocalDateTime (mapped as TIMESTAMP)
Sub-objects with the same key under different inner map objects in the same List (table) must be the same JAVA type, otherwise an IllegalArgumentException will be thrown when executing queries.
The DefaultMetadataProvider infers columns and their types from the data itself, it will merge all valid sub-object's keys to the full column list of the mapped table.
Users can write custom MetadataProviders to fetch columns and their data types from external storages.