Rahul Raj > Can anyone point me to a standalone example of SQL Advisor? I
went through
Rahul Raj> the test cases, but the test setups were slightly complicated to
understand.

It heavily depends on the way you use Calcite.
Do you use java.sql.Connection?
Do you use just Parser?

Here's how I use advisor.

I add "get_hints" function to the schema:
https://github.com/vlsi/mat-calcite-plugin/blob/add281383967f957b4188e623c964bf00b03aa6f/MatCalcitePlugin/src/com/github/vlsi/mat/calcite/neo/PackageSchema.java#L103

Then I execute it via SQL interface:
https://github.com/vlsi/mat-calcite-plugin/blob/add281383967f957b4188e623c964bf00b03aa6f/MatCalcitePlugin/src/com/github/vlsi/mat/calcite/editor/CalciteContentAssistantProcessor.java#L54-L56

Note, there's undocumented API (
https://github.com/vlsi/mat-calcite-plugin/blob/add281383967f957b4188e623c964bf00b03aa6f/MatCalcitePlugin/src/com/github/vlsi/mat/calcite/editor/CalciteContentAssistantProcessor.java#L69-L74
), however I don't really remember if there's much difference between the
two. Note that undocumented might disappear at any moment though.

Vladimir

Reply via email to