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

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

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

    https://github.com/apache/metamodel/pull/85#discussion_r49311269
  
    --- 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 --
    
    I fully agree with this comment. I don't like these changes at all but 
again not sure how to implement your suggestions to improve it.


> 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