{"id":21376349,"url":"https://github.com/gerardnico/calcite","last_synced_at":"2025-07-26T00:39:50.288Z","repository":{"id":41309984,"uuid":"247161825","full_name":"gerardnico/calcite","owner":"gerardnico","description":"Calcite Demo","archived":false,"fork":false,"pushed_at":"2020-04-12T18:25:42.000Z","size":338,"stargazers_count":32,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T08:51:59.481Z","etag":null,"topics":["calcite","calcite-demo","java","optimization","relational-algebra","sql","sql-engine","sql-parser","sqlnode"],"latest_commit_sha":null,"homepage":"https://gerardnico.com/db/calcite/getting_started","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gerardnico.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-13T21:07:48.000Z","updated_at":"2025-03-30T09:52:20.000Z","dependencies_parsed_at":"2022-08-26T06:21:34.077Z","dependency_job_id":null,"html_url":"https://github.com/gerardnico/calcite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gerardnico/calcite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardnico%2Fcalcite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardnico%2Fcalcite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardnico%2Fcalcite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardnico%2Fcalcite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gerardnico","download_url":"https://codeload.github.com/gerardnico/calcite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardnico%2Fcalcite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265128144,"owners_count":23715621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calcite","calcite-demo","java","optimization","relational-algebra","sql","sql-engine","sql-parser","sqlnode"],"created_at":"2024-11-22T09:15:06.115Z","updated_at":"2025-07-13T10:30:58.035Z","avatar_url":"https://github.com/gerardnico.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calcite Demo's\n\n[![Build Status](https://travis-ci.org/gerardnico/calcite.svg?branch=master)](https://travis-ci.org/gerardnico/calcite)\n\n## About\n\nA repository of [Calcite](https://calcite.apache.org/) demo's \n\n\n\u003e Note: This demos are using a lot of [Reflective Schema](src/test/java/com/gerardnico/calcite/CalciteSchemaTest.java) \n\u003e (ie schema in the code) but in practice, you would connect to a data store (database, adapter) to get a schema.\n\n\n## Getting Started Demos\n\n  * [Getting Started Article](https://gerardnico.com/db/calcite/getting_started) \n    * [Getting Started Code](src/test/java/com/gerardnico/calcite/CalciteFrameworksTest.java) - parse sql, validate, transform to relation expression and execute with a [Planner](https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/tools/Planner.java)\n\n  * [HelloWorld of the official documentation](https://calcite.apache.org/docs/index.html)\n    * [HelloWorld Code](src/main/java/com/gerardnico/calcite/demo/HelloWorld.java) - A query (The first demo of the doc)\n  \n## Demo Schema and Catalog\n        \n  * [Reflective Schema](src/test/java/com/gerardnico/calcite/CalciteSchemaTest.java) - Shows how to create a schema from Java Object via reflexion\n  * [Catalog Reader](src/test/java/com/gerardnico/calcite/CalciteCatalogsTest.java) - read the schema and tables from a catalog\n\n## Demo Sql Parsing and validation\n \nSelect Statement:\n  * [Sql Select Info](src/test/java/com/gerardnico/calcite/CalciteSqlSelectTest.java) - Parse a Select Sql and extracts tokens\n  * [Sql Select Visitor](src/test/java/com/gerardnico/calcite/CalciteSqlVisitorTest.java) - Parse a Select Sql and build the tree (SqlNode) and visit it\n  * [Sql Pretty Print](src/test/java/com/gerardnico/calcite/CalciteSqlWriterTest.java) - Parse a SQL to SqlNode and print it pretty\n  * [Sql Validation](src/test/java/com/gerardnico/calcite/CalciteSqlValidationTest.java) - Parse a SQL to SqlNode and validate it\n\nThere is also other [node type](https://github.com/apache/calcite/tree/master/core/src/main/java/org/apache/calcite/sql):\n  * [SqlCreate](https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql/SqlCreate.java)\n  * [SqlInsert](https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql/SqlInsert.java)\n  * ...\n\n\n## Demo Logical Relational Expression\n\n * [Relational Logical Expression](src/test/java/com/gerardnico/calcite/CalciteRelLogicalExpressionTest.java) - shows how to create several relational logical expression, print the sql and execute them\n * [Relational Expression from Jdbc Schema](src/test/java/com/gerardnico/calcite/CalciteRelJdbcTest.java) From RelBuilder based on a Jdbc data store, build a relational expression and transform it to SQL.\n\n## Demo Optimization / Cost\n   \n  * [Relational Expression Optimization with the HepPlanner](src/test/java/com/gerardnico/calcite/CalcitePlannerHepTest.java) - shows the filter early optimization\n  * [Relational Expression Optimization  with the Volcano Planner (and cost)](src/test/java/com/gerardnico/calcite/CalcitePlannerVolcanoTest.java) - optimization with the Volcano Planner\n\n \n  \n## FYI\n\n  * This code is an extract and adaptation of the test core project of calcite.\n  * The database used are `Hsqldb` and `H2` and the data files such as `SCOTT` are also in a jar dependency file.\n\n  \n## Doc / Reference\n\n  * [Calcite demo in notebook](https://github.com/michaelmior/calcite-notebooks)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerardnico%2Fcalcite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerardnico%2Fcalcite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerardnico%2Fcalcite/lists"}