[ 
https://issues.apache.org/jira/browse/CALCITE-3187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16883227#comment-16883227
 ] 

Julian Hyde commented on CALCITE-3187:
--------------------------------------

[~laurent] I think that in your comment, for the second RelDataTypeFactory you 
meant to write RelDataTypeSystem.

I had forgotten that the methods were already in RelDataTypeFactory. We changed 
tack a year or so later when we added RelDataTypeSystem, and have been adding 
type-derivation methods there ever since. I think that RelDataTypeSystem is the 
right place for the new methods, and that we should move the old methods there 
(leaving deprecated methods to forward).

What do you think of having the 2 existing methods ({{createDecimalProduct}} 
and {{createDecimalQuotient}}) and 2 new methods ({{createDecimalMod}} and 
{{createDecimalAddition}}) instead return {{SqlReturnTypeInference}} strategy 
objects? That will allow the code to live in {{ReturnTypes.java}}, and make 
re-use straightforward. I would name them 
{{getDecimalMultiplyReturnTypeInference()}}, 
{{getDecimalPlusReturnTypeInference()}}, 
{{getDecimalDivideReturnTypeInference()}} and 
{{getDecimalModReturnTypeInference()}}, using the names of the operators from 
{{SqlStdOperatorTable}}.

> Derive all decimal return type through type factory
> ---------------------------------------------------
>
>                 Key: CALCITE-3187
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3187
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Praveen Kumar Desabandu
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Currently decimal product and quotient return types are derived through type 
> factory, this allows clients to override the return type if they so desire.
> But decimal sum is embedded in return types, also decimal mod does not have a 
> return type inference defined.
> This task is to derive all of the return types through type factory, so that 
> clients can override if they wish to.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to