You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2020/11/03 00:27:00 UTC

[jira] [Comment Edited] (CALCITE-4371) TableMacro and TableFunction should have List rather than List parameters
    [ https://issues.apache.org/jira/browse/CALCITE-4371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17225026#comment-17225026 ] 

Julian Hyde edited comment on CALCITE-4371 at 11/3/20, 12:26 AM:
-----------------------------------------------------------------

It's not really a problem in practice because the only code that calls those methods is generated (and uses raw types) or generic code that is happy to build lists of Object.

But sure, go ahead if you think it's important.


was (Author: julianhyde):
It's not really a problem in practice because the only code that calls those methods is generated (and uses raw types) or generic code that is happy to build lists of Object.

> TableMacro and TableFunction should have List<? extends Objects> rather than List<Object> parameters
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4371
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4371
>             Project: Calcite
>          Issue Type: Sub-task
>          Components: core
>    Affects Versions: 1.26.0
>            Reporter: Vladimir Sitnikov
>            Assignee: Vladimir Sitnikov
>            Priority: Major
>
> Currently, the functions are declared as follows:
> {code:java}public interface TableMacro extends Function {
>   /**
>    * Applies arguments to yield a table.
>    *
>    * @param arguments Arguments
>    * @return Table
>    */
>   TranslatableTable apply(List<Object> arguments);
> }
> {code}
> That means the method can't be called with {{List<String>}} parameter.
> It makes sense to adjust the parameter type to {{List<? extends Object>}}, then the call with {{List<String>}} would succeed.
> Note: this is source-incompatible change. So all the classes that implement TableMacro and TableFunction would need to be adjusted.
> Calcite codebase has <10 such classes, so I believe it should be ok.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)