Recently, there is a project need to use calcite, helpless online Chinese information is not many, find the official tutorial, anger translation ~ ~ ~ put on the csdn, with the vast number of peers to share.
This article is translated by Baicho, please keep these 3 lines of text.
Original English website: http://calcite.apache.org/docs/tutorial.html
URL: http://blog.csdn.net/bluejoe2000/article/details/51459281 calcite Tutorial
This tutorial guides you through the steps to build and connect to calcite. This tutorial simulates the directory of a CSV file into a structure containing a table (schema) by using a simple adapter (adapter). The rest of the work has calcite to do, and it will eventually provide a complete SQL interface.
Calcite-example-csv is a full-featured calcite adapter that is responsible for reading text files in CSV format. It is worth mentioning that a mere 200 lines of code can get full SQL functionality.
Calcite-example-csv also provides a good template for the construction of adapters in other data formats. Although there are not many lines of code, it covers several important concepts: using the Schemafactory and schema interfaces to customize the schema, declaring the schema in the model JSON file, declaring the view in the model JSON file, and customizing the table using the table interface; Defines the record type of the table, using the Scannabletable interface to provide a simple table implementation that directly enumerates each row of the table, and uses the Filteredtable interface to provide a more advanced table implementation, which will filter the rows for simple predicates; Using the Translateabletable interface for more advanced table, it can use scheduling rules to translate relational operators; Download and build