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