vlsi commented on issue #1766: [CALCITE-3745] UnitCompiler can not find 
required class information.
URL: https://github.com/apache/calcite/pull/1766#issuecomment-576537203
 
 
   @gr4ve , this is relevant: 
https://www.programcreek.com/2011/09/what-is-the-difference-between-a-java-library-and-a-framework/
   
   I like how Calcite is more like a library, and Calcite should avoid creating 
its own rules for the execution environment (e.g. static variables, threading 
model, and so on).
   
   You suggest to create a `ThreadLocal`, however, it would break if multiple 
classloaders would be required at the same time. For instance, if metadata 
request needs to create its own connection to fetch some extra data, then you 
won't be able to use a single `theradLocal` to provide two distinct 
classloaders.
   
   It is sad the current code resorts to 
`JaninoRexCompiler.class.getClassLoader()`, however, the use of thread locals 
for configuration is rarely a good choice for a library.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to