Hi Calcite Dev,

I have the below requirements.
1. Get the result set from the Database
2.  convert to JSON, do some modifications to JSON
3. Again convert to ResultSet from JSON, and send it back to the user as a
resultset

I am not getting how to achieve this using calcite-core as JAR to used in
database tools like DBeaver.

I tried the below workaround but it did not work.
1. run the query to the database using Statement's executeQuery
2. convert ResultSet to a JSON file and store it locally.
3.  query from the local JSON file, using statement.executeQuery .
4. return resultset from step 3.

public ResultSet executeQuery(String sql) throws SQLException {

   ResultSet rs1 = super.executeQuery(sql); // step 1

   // Convert resultSet(rs1) to JSON and store it locally, where
model.json's directory is defined . //step 2

   // change in schema name in sql as per defined in model.json

   ResultSet rs2 = super.executeQuery(sql);  //step 3

  return res2;

}

As of now I am trying only select * from table query, not complex queries .

Please help me , how can i approach in this requirement . It worked
when JSON file is already present , but it fails with Null pointer
exception if storing and then running executeQuery on that.

(Tried sleeping current thred also, no luck)


Thanks in advance .

Regards,

Kartik

Reply via email to