{"id":16333140,"url":"https://github.com/fzakaria/calcite-git","last_synced_at":"2025-07-23T04:35:16.839Z","repository":{"id":54618898,"uuid":"336914292","full_name":"fzakaria/calcite-git","owner":"fzakaria","description":"A native Calcite Git adapter","archived":false,"fork":false,"pushed_at":"2021-02-09T18:19:23.000Z","size":56,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-07T11:47:03.514Z","etag":null,"topics":["apache","calcite","git","java","relational-algebra","sql"],"latest_commit_sha":null,"homepage":"https://calcite.apache.org","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fzakaria.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-07T23:39:37.000Z","updated_at":"2023-06-02T19:43:10.000Z","dependencies_parsed_at":"2022-08-13T21:40:56.477Z","dependency_job_id":null,"html_url":"https://github.com/fzakaria/calcite-git","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fzakaria/calcite-git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzakaria%2Fcalcite-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzakaria%2Fcalcite-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzakaria%2Fcalcite-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzakaria%2Fcalcite-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fzakaria","download_url":"https://codeload.github.com/fzakaria/calcite-git/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzakaria%2Fcalcite-git/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266618939,"owners_count":23957273,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["apache","calcite","git","java","relational-algebra","sql"],"created_at":"2024-10-10T23:34:28.608Z","updated_at":"2025-07-23T04:35:16.812Z","avatar_url":"https://github.com/fzakaria.png","language":"Java","readme":"# Calcite Git Adapter\n\n![Maven Central](https://img.shields.io/maven-central/v/com.github.fzakaria/calcite-git)\n![GitHub](https://img.shields.io/github/license/fzakaria/calcite-git)\n[![javadoc](https://javadoc.io/badge2/com.github.fzakaria/calcite-git/javadoc.svg)](https://javadoc.io/doc/com.github.fzakaria/calcite-git)\n\nThis is a [Calcite](https://calcite.apache.org/) adapter for [Git](https://git-scm.com/) that uses\nthe [JGit](https://www.eclipse.org/jgit/) library.\n\n\u003e JGit is a lightweight, pure Java library implementing the Git version control system\n\nThis is adapter is similar in spirit to [GitCommitsTableFunction](https://github.com/apache/calcite/blob/d9a81b88ad561e7e4cedae93e805e0d7a53a7f1a/plus/src/main/java/org/apache/calcite/adapter/os/GitCommitsTableFunction.java)\nwhich his included in the Calcite repository, however by using JGit, the goal is to be able to expose more powerful\nplanning optimizations, and simpler code.\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.fzakaria\u003c/groupId\u003e\n  \u003cartifactId\u003ecalcite-git\u003c/artifactId\u003e\n  \u003cversion\u003e0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Demo\n\nA helpful `exec:java` is included that will start up [sqlline](https://github.com/julianhyde/sqlline) with the\nproper driver loaded pointing to the current directory.\n\n```bash\n❯ mvn exec:java\n[INFO] Scanning for projects...\n[INFO] \n[INFO] -------------------\u003c io.github.fzakaria:calcite-git \u003e-------------------\n[INFO] Building calcite-git 1.0-SNAPSHOT\n[INFO] --------------------------------[ jar ]---------------------------------\n[INFO] \n[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ calcite-git ---\n20:32:33.601 [sqlline.SqlLine.main()] WARN  i.g.f.calcite.adapter.git.GitDriver - No directory provided, defaulting to /home/fmzakari/code/github.com/fzakaria/calcite-git\nTransaction isolation level TRANSACTION_REPEATABLE_READ is not supported. Default (TRANSACTION_NONE) will be used instead.\nsqlline version 1.9.0\n0: jdbc:git:\u003e !tables\n+-----------+-------------+------------+--------------+---------+----------+------------+-----------+---------------------------+------+\n| TABLE_CAT | TABLE_SCHEM | TABLE_NAME |  TABLE_TYPE  | REMARKS | TYPE_CAT | TYPE_SCHEM | TYPE_NAME | SELF_REFERENCING_COL_NAME | REF_ |\n+-----------+-------------+------------+--------------+---------+----------+------------+-----------+---------------------------+------+\n|           | git         | COMMITS    | TABLE        |         |          |            |           |                           |      |\n|           | metadata    | COLUMNS    | SYSTEM TABLE |         |          |            |           |                           |      |\n|           | metadata    | TABLES     | SYSTEM TABLE |         |          |            |           |                           |      |\n+-----------+-------------+------------+--------------+---------+----------+------------+-----------+---------------------------+------+\n0: jdbc:git:\u003e select c.id, c.author.created_at, c.author.name from commits as c;\n+------------------------------------------+-----------------------+---------------+\n|                    ID                    |      CREATED_AT       |     NAME      |\n+------------------------------------------+-----------------------+---------------+\n| bcb92091ef526f24908761d867d6e08b9a83ca5f | 2021-02-08 04:10:02.0 | Farid Zakaria |\n| 6827d9e82290c81422b77eeb9d25fccdea164c3c | 2021-02-08 02:29:39.0 | Farid Zakaria |\n| 9e0acbd0afe66eb2dc2c376fa95456460dd5e128 | 2021-02-07 23:52:58.0 | Farid Zakaria |\n| cbd71f6421597c2e1c1a4dbe098c653fdd11628a | 2021-02-07 23:51:50.0 | Farid Zakaria |\n| ccd0020a85f2b719ae89d37b5cd059321fbcb98d | 2021-02-07 23:43:24.0 | Farid Zakaria |\n| 7b3eb02c4f7cb7a91f82726d56add680c7e80d28 | 2021-02-07 23:40:16.0 | Farid Zakaria |\n| ad6c8068e70f98ae7c41d779b0b1e3cf006788e2 | 2021-02-07 21:12:45.0 | Farid Zakaria |\n| 504132ce9bf52d7ce5d1d507f6ac8368590b78e5 | 2021-02-07 21:12:25.0 | Farid Zakaria |\n+------------------------------------------+-----------------------+---------------+\n8 rows selected (0.937 seconds)\n```\n\nIf you would like to use it directly in your code with _jdbc_ here is a minimal example.\n```java\npublic class Main {\n    public static void main(String[] args) {\n       final Properties info = new Properties();\n        try (Connection connection = DriverManager.getConnection(\"jdbc:git:\", info)) {\n            try (Statement statement = connection.createStatement()) {\n                final ResultSet resultSet = statement.executeQuery(\"select * from commits limit 10\");\n                // take a peek at the tests for how to parse the ResultSet\n            }\n        }\n    }\n}\n```\n\nPlease consult the tests for additional examples.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzakaria%2Fcalcite-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffzakaria%2Fcalcite-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzakaria%2Fcalcite-git/lists"}