If you can write all of this as Java code and the JIT can handle it, that would be great. But I’d be surprised.
If freemarker template for a particular function is complex, that is probably because it is doing a lot of customization for particular cases. In other words, it is adding a lot of value. If the templates make simple things look simple and complex things possible, they are a textbook example of a good architecture. Don’t throw them out. You know the code a lot better than I do. If you have any counter-examples to what I’ve said above, please prove me wrong. :) Julian On Apr 27, 2015, at 2:57 PM, Mehant Baid <[email protected]> wrote: > Hey All, > > We use freemarker templates extensively for generating source code for value > vectors and functions. However over time the template logic for functions has > become complicated with the need to modify the function templates based on > input data type, nullability, function type etc. This makes the template code > extremely hard to read and debug. Proposal going forward is to de-templatize > the functions and check-in the source for various functions (like how we have > been doing in recent times for hash functions etc). Although its not ideal as > it involves some code duplication but the advantage is that the source is > then 'IDE friendly' and much more readable. As part of the work for > DRILL-2870 I am planning to de-templatize the aggregate functions. > > Thanks > Mehant
