metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From albertostratio <...@git.apache.org>
Subject [GitHub] metamodel pull request: METAMODEL-224 CONCAT function support
Date Mon, 11 Jan 2016 11:26:22 GMT
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.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message