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

    https://github.com/apache/metamodel/pull/85#discussion_r49618013
  
    --- 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 --
    
    @kaspersorensen that was my first approach but I found a lot of problems 
when we don't have a column within the SelectItem. I guess the CONCAT function 
is a quite particular case because it might receive several columns but most of 
the rest of the scalar functions we will be receiving just one column.
    
    I would keep this approach as a first attempt and then when we implementing 
another string scalar functions, such as SUBSTRING, evaluate whether this 
approach fits for the rest of them and if not we can modify it. What do you 
think?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to