[
https://issues.apache.org/jira/browse/CALCITE-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16833184#comment-16833184
]
Rong Rong edited comment on CALCITE-3008 at 5/5/19 1:20 AM:
------------------------------------------------------------
Following up on this topic here. Any suggestion on the {{RexRexConverlet}} API:
I am thinking something like {{SqlRexConvertlet}}, where:
{code:java}
public interface RexRexConvertlet {
public RexNode convert(RexBuilder rexBuilder, RexNode groupCall, RexNode...
rexExpressions);
}
{code}
And a {{RexRexConvertletTable}} is needed, for example, a standard convertlet
table that contains the implementation of the {{AuxiliaryConverter}} as an
extension of this as a {{GroupRexAuxiliaryConvertletImpl}} that specifically
converts the list of group calls related to time attributes.
---------------------
Alternatively, I also have an idea to implement this similar to
{{RexSqlConvertlet}}:
{code:java}
public interface RexRexConverlet {
public RexNode convert(AuxiliaryConverter converter, RexNode groupCall,
RexNode... rexExpressions);
}
{code}
In this case, the auxiliary converter is passed to the RexRexConvertlet, via
the SqlOperatorTable method {{AuxiliaryConverter
getAuxiliaryConverter(SqlFunction)}}. and we always call the
RexRexConverlet.convert. in this case, depends on what is registered in the
SqlOperatorTable, different auxiliary converter can be used for different
operators (e.g. TUMBLE_BEGIN / TUMBLE_END / etc will register with their own
auxiliary converter; a normal group-by function is a pass through). It will
also be able to support user define function.
was (Author: walterddr):
Following up on this topic here. Any suggestion on the {{RexRexConverlet}} API:
I am thinking something like {{SqlRexConvertlet}}, where:
{code:java}
public interface RexRexConvertlet {
public RexNode convert(RexBuilder rexBuilder, RexNode groupCall, RexNode...
rexExpressions);
}
{code}
And a {{RexRexConvertletTable}} is needed, for example, a standard convertlet
table that contains the implementation of the {{AuxiliaryConverter}} as an
extension of this as a {{GroupRexAuxiliaryConvertletImpl}} that specifically
converts the list of group calls related to time attributes.
Alternatively, I also have an idea to implement this similar to
{{RexSqlConvertlet}}:
{code:java}
public interface RexRexConverlet {
public RexNode convert(AuxiliaryConverter converter, RexNode groupCall,
RexNode... rexExpressions);
}
{code}
In this case, the auxiliary converter is passed to the RexRexConvertlet, via
the SqlOperatorTable method {{AuxiliaryConverter
getAuxiliaryConverter(SqlFunction)}}. and we always call the
RexRexConverlet.convert. in this case, depends on what is registered in the
SqlOperatorTable, different auxiliary converter can be used for different
operators (e.g. TUMBLE_BEGIN / TUMBLE_END / etc will register with their own
auxiliary converter; a normal group-by function is a pass through). It will
also be able to support user define function.
> Making AuxiliaryConverter Pluggable
> -----------------------------------
>
> Key: CALCITE-3008
> URL: https://issues.apache.org/jira/browse/CALCITE-3008
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Rong Rong
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Currently the {{AuxiliaryConverter}} in calcite core is set to be static with
> only one basic implementation. It would be nice to have it pluggable so that
> other systems can implement its own.
> Was wondering if this would be a good feature to add?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)