Hi folks: 
I apologize for sending the message again but wanted to see if there is any 
advice/pointers on understanding Calcite code generation.   If I have missed 
the response, please forward it to one more time.
Thanks again for your help.
Mans
 Hi:
I am working on a project that requires changing the query and the data at run 
time.  The data to be processed will be stored in memory as a list of strings.  
I am using java 8 at the moment.
I wanted to understand how the classes are generated in Calcite using janino at 
run time.  
Questions:
1. If the query is executed on the same data twice, does it generate the code 
twice ? If so, are all the classes regenerated or only specific ones ?2. If the 
query changes are all the classes regenerated ?3. If the process keeps running, 
will the regenerated classes cause oom ?  If so, is there any way to avoid 
this. 4. Is there a way to remove the generated classes at runtime ?5. Is there 
any way in Calcite to avoid generating the classes if the data or query changes 
while the process is running ?
I tried one of the csv example tests at added the following sql line twice (as 
shown in the snippet below) 
(https://github.com/apache/calcite/blob/master/example/csv/src/test/java/org/apache/calcite/test/CsvTest.java#L351)
 and it does appear to generate some classes twice but please feel free to 
correct me if I am mistaken.
<snippet>
  @Test void testFilterableWhereTwice() throws SQLException {    final String 
sql =        "select empno, gender, name from EMPS where name = 'John'";    
sql("filterable-model", sql)        .returns("EMPNO=110; GENDER=M; 
NAME=John").ok();
    sql("filterable-model", sql)        .returns("EMPNO=110; GENDER=M; 
NAME=John").ok();  }
</snippet>

If there is any documentation, example, or advice, on how code generation 
works, is there a way to avoid it, please let me know.
Thanks  

Reply via email to