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

ASF GitHub Bot commented on METAMODEL-224:
------------------------------------------

Github user kaspersorensen commented on a diff in the pull request:

    https://github.com/apache/metamodel/pull/85#discussion_r49463245
  
    --- Diff: 
core/src/test/java/org/apache/metamodel/QueryPostprocessDataContextTest.java ---
    @@ -294,6 +294,29 @@ public void testScalarFunctionWhere() throws Exception 
{
             ds.close();
         }
     
    +    public void testScalarFunctionConcat() throws Exception {
    +        MockDataContext dc = new MockDataContext("sch", "tab", "1");
    +        Table table = dc.getDefaultSchema().getTables()[0];
    +        MutableColumn col = new MutableColumn("foo").setTable(table);
    +        MutableColumn col2 = new MutableColumn("bar").setTable(table);
    +        Object[] functionParams = new Object[3];
    +        functionParams[0] = col;
    +        functionParams[1] = "$";
    +        functionParams[2] = col2;
    +        Query query = dc.query()
    +                .from(table)
    +                .select(col, FunctionType.CONCAT, functionParams)
    --- End diff --
    
    Actually here I realize that the function is created "only" with the 
functionParams as the parameters - NOT with the first col as a true parameter. 
Maybe that's the cause of all the exceptions I see in the code. But I think 
maybe then we should introduce a new SelectItem constructor (and builder 
methods etc) which does not take the initial column or select item but JUST a 
function and it's parameters.


> Support CONCAT function
> -----------------------
>
>                 Key: METAMODEL-224
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-224
>             Project: Apache MetaModel
>          Issue Type: New Feature
>            Reporter: Alberto
>            Priority: Minor
>
> As we now support scalar functions it would be great to add support for a 
> CONCAT function that allow us to concatenate and append strings to the query 
> results.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to