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