Thanks for creating this project, Satya! It's great seeing projects built around Calcite to improve developer experience.

If we were to integrate the code into avatica-go, it should be done as a separate module. It would reside in it's folder, which following go conventions would be cmd/cli and have its own go.mod file.

The reason for this is that the cli pulls in its own dependencies (including avatica-go), but avatica-go does not use the same dependencies as the cli. In other words, if both the cli and avatica-go are in the same module, someone installing avatica-go would need to pull in unneeded dependencies.

In terms of releasing, things might be a bit more complicated. If the cli is its own separate module, then it should be able to have its own release schedule. For the git tag, it would be tagged as cmd/cli/vX.Y.Z. However, we ship a tar.gz containing the repository's contents as the release and it would contain the code for both avatica-go and the cli, even though the release might be for just avatica-go or just the cli. Not sure how this fits in with the ASF's release guidelines, so this will need a bit more exploration.

As for the JDBC equivalent in Go, that would be the database/sql package [1], of which avatica-go is a driver. From past experience, I have not seen a cli tool included with a database/sql driver, so if we were to keep with the "Go way" of doing things, then perhaps it's not the best idea to integrate the code into avatica-go.

The calcite-cli project includes calcite-specific features such as the built in list of keywords [2]. This is in contrast to a popular, general tool that works with all database/sql drivers: usql [3].

In my personal opinion, I think calcite-cli is an excellent project for the Calcite ecosystem. However, I feel that it would be better as an independent project, whether as a subproject under calcite or not, rather than integrating it into avatica-go, for the reasons aforementioned.

Francis

[1] https://pkg.go.dev/database/sql
[2] https://github.com/satyakommula96/calcite-cli/blob/main/prompt/completer.go
[3] https://github.com/xo/usql

On 16/10/2023 4:17 pm, Julian Hyde wrote:
This project seems to do a similar job to SQLLine, except that it is
written in Go rather than Java, and speaks the Avatica protocol rather
than JDBC.

A few observations:

1. The best fit for it would be in the avatica-go project. But SQLLine
has been successful as an independent project (not tied to any
particular back-end). The loose coupling has been successful for both
Calcite/Avatica and SQLLine. So, I wonder whether this could also be
successful as an independent project. Avatica-go could reference it,
in the same way that Calcite includes a bash script to launch SQLLine,
even though SQLLine is independently developed, versioned and
released.

(Hive forked SQLLine to create a utility, BeeLine, that is now part of
their source tree. In my opinion that was a mistake. It would have
been better if they had referenced SQLLine, and added hooks to
customize it.)

2. Would it be possible to make this CLI more loosely coupled? Maybe
it should depend on Go's equivalent of JDBC (sorry I'm no Go expert)
rather than directly on the Avatica API. Then it could be used as a
CLI to talk to other databases.

Julian







On Sun, Oct 15, 2023 at 8:01 AM Hongyu Guo <guohongyu...@gmail.com> wrote:

Hi Satya,
I take a quick look for your repository, I'm not sure if your project has
already finished, I notice some .go file is empty, did you forget to push
some commits?

 From the current code, you have imported the calcite-avatica-go project and
provided a command line tool. I don't think you need to create a new
project, it would be better choice to submit the new feature you mentioned
in the form of a Pull Request to calcite-avatica.

You can log a new JIRA case first.

Best,
Hongyu Guo

Satya Kommula <satyakomm...@ymail.com.invalid> 于2023年10月15日周日 13:49写道:

Dear Apache Calcite Development Team,

I hope this message finds you well. I am writing to express my interest in
donating the "calcite-cli" repository, available at "
https://github.com/satyakommula96/calcite-cli"; to the Apache Calcite
project. This repository provides a valuable SQL prompt for executing both
multiline and single-line queries, which aligns with the capabilities of
the Calcite project.
The "calcite-cli" repository has been developed with the aim of enhancing
the SQL querying experience by providing features that align with the
principles and objectives of Apache Calcite. It enables users to work with
complex queries, offering both multiline and single-line query support,
which is crucial for a wide range of use cases.
I believe that integrating "calcite-cli" with the Apache Calcite project
would be mutually beneficial. It would provide the Calcite community with a
valuable tool for query execution and testing, and it would allow me to
contribute to the ongoing development and improvement of Apache Calcite. I
am committed to supporting and maintaining this repository in collaboration
with the Calcite community.
I kindly request that you consider accepting this donation and provide
guidance on the process for transferring ownership and control of the
"calcite-cli" repository to the Apache Calcite project. Please let me know
if there are any specific steps or requirements I need to follow to
facilitate this process.
I am excited about the possibility of contributing to the Apache Calcite
project and further advancing the capabilities of the SQL prompt. Your
feedback and guidance are highly appreciated, and I am looking forward to
being a part of the Apache Calcite community.
Thank you for your time and consideration.
Best regards,Satya Kommula.

Reply via email to