Here is my sample code :
Main java prog :
Connection con =
DriverManager.getConnection("jdbc:calcite:model=modelDremio.json");
final String query = "SELECT * FROM \"table\" ";
Statement statement = con.createStatement();
ResultSet rs = statement.executeQuery(query); // exception throws
here.
my sample model file : modelDremio.json
{
"version": "1.0",
"defaultSchema": "schemaName",
"schemas": [
{
"name": "schemaName",
"type": "custom",
"factory": "org.apache.calcite.adapter.jdbc.JdbcSchema$Factory",
"operand": {
"jdbcDriver": "com.dremio.jdbc.Driver",
"jdbcUrl": "jdbc:dremio:direct=XXXXXXX:PORT_NO",
"jdbcUser": "USERANME",
"jdbcPassword": "PASSWORD",
"caseSensitive" : "false",
}
}
]
}
On Fri, Sep 9, 2022 at 1:02 PM Kartik Kudada <[email protected]>
wrote:
> Hi Developers ,
>
> Hope you are doing well!
> I am a newbie in Calcite . I have cloned the Calcite repository, and I
> created Java main program to connect and query to Dremio database .
>
> Connection is successful but the below query throws an exception saying
> object not found.
> I am trying.
> SELECT * from "SCHEMA"."TABLENAME" ;
>
> The similar select query for oracle and MySql worked.
> SELECT * FROM " SCHEMA "." TABLENAME "
>
> Can't I query dremio database using calcite ?
> Any lead will be helpful.
>
> Regards,
> Kartik
>