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

    https://github.com/apache/metamodel/pull/85#discussion_r49636369
  
    --- 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 --
    
    But my concern is actually that in this case you may also have many columns 
(or rather I prefer to think of it as SelectItems because even those could (one 
day when we support it) be function calls), for instance:
    
    ```
    SELECT CONCAT( name, " ", TO_STRING(age), " - ", hometown ) FROM people
    ```
    
    ... but today we might settle on "only" supporting simple selectitems as 
parameters, so:
    ```
    SELECT CONCAT( name, " ", age, " - ", hometown ) FROM people
    ```
    ... that would for me be a reasonable limitation for a first version.
    
    But my worry is that if it's a problem to not have a column in the 
SelectItem then I'm sure it's also a problem that we have (in the above case) 
essentially 3 columns referred. I can imagine that this would work mostly then 
based on coincidence (maybe age and hometown are also materialized by some 
coincidence rather than conscious design). I know this is maybe making life 
hard on you, but it feels wrong to go ahead with a solution that feels unstable 
because of this.


---
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