You can provide an instance of "org.apache.calcite.rel.type.RelDataTypeSystemImpl" to the "org.apache.calcite.tools.Frameworks.ConfigBuilder" to return a different type for "some" functions such as SUM and AVG. I'd love to know if there is another way to override the output type of a any function but I don't know if there is such a thing.
Thanks, Gelbana On Wed, Jun 12, 2019 at 8:46 AM Maria <[email protected]> wrote: > Embarrassing , My question is how to decide these aggregate result type ? > > > At 2019-06-12 13:40:42, "Maria" <[email protected]> wrote: > >Hi, all: I'm using the es-adapter to do some aggregating,such like > count(),sum(),avg()..... BUT, these ops will generate new virtual > column,maybe something was done by calcite itself to deduce appropriate > datatype for this? > >I saw some description in http://calcite.apache.org/docs/reference.html: > > "Calcite deduces the parameter types and result type of a function > from the parameter and return types of the Java method that implements it. " > >So the question is does this matter? > > > > > >Thanks for any reply. > >Best Regards. > > >
