[
https://issues.apache.org/jira/browse/METAMODEL-224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15089188#comment-15089188
]
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_r49186531
--- Diff: core/src/main/java/org/apache/metamodel/query/SelectItem.java ---
@@ -484,11 +498,24 @@ public StringBuilder toStringNoAlias(boolean
includeSchemaInColumnPath) {
final Object[] functionParameters = getFunctionParameters();
if (functionParameters != null && functionParameters.length !=
0) {
for (int i = 0; i < functionParameters.length; i++) {
- functionBeginning.append('\'');
- functionBeginning.append(functionParameters[i]);
- functionBeginning.append('\'');
+ if (functionParameters[i] instanceof Column) {
+ Column col = (Column) functionParameters[i];
+
functionBeginning.append(getToStringColumnPrefix(includeSchemaInColumnPath,
col));
+ functionBeginning.append(col.getQuotedName());
+ } else {
+ if
(!_function.getFunctionName().equals(FunctionType.CONCAT.getFunctionName())) {
+ functionBeginning.append('\'');
+ }
+ functionBeginning.append(functionParameters[i]);
+ if
(!_function.getFunctionName().equals(FunctionType.CONCAT.getFunctionName())) {
+ functionBeginning.append('\'');
+ }
--- End diff --
Also the changes here seem very unfortunate because they have a
specific-case exception for something that is very general. If we instead just
made sure that _any_ function could have select item as parameter, then we're
in a much better position.
> 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)