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

ASF GitHub Bot commented on PHOENIX-6920:
-----------------------------------------

Aarchy commented on code in PR #1665:
URL: https://github.com/apache/phoenix/pull/1665#discussion_r1321150235


##########
phoenix-core/src/main/java/org/apache/phoenix/compile/ProjectionCompiler.java:
##########
@@ -470,10 +470,24 @@ public static RowProjector compile(StatementContext 
context, SelectStatement sta
                         
ExpressionCompiler.throwNonAggExpressionInAggException(expression.toString());
                     }
                 }
-                String columnAlias = aliasedNode.getAlias() != null ? 
aliasedNode.getAlias() : 
SchemaUtil.normalizeIdentifier(aliasedNode.getNode().getAlias());
-                boolean isCaseSensitive = aliasedNode.getAlias() != null ? 
aliasedNode.isCaseSensitve() : (columnAlias != null ? 
SchemaUtil.isCaseSensitive(aliasedNode.getNode().getAlias()) : 
selectVisitor.isCaseSensitive);
-                String name = columnAlias == null ? expression.toString() : 
columnAlias;
-                projectedColumns.add(new ExpressionProjector(name, 
tableRef.getTableAlias() == null ? (table.getName() == null ? "" : 
table.getName().getString()) : tableRef.getTableAlias(), expression, 
isCaseSensitive));
+
+                String tableName = tableRef.getTableAlias() == null ?
+                        (table.getName() == null ?
+                                "" :
+                                table.getName().getString()) :
+                        tableRef.getTableAlias();
+                String colName = 
SchemaUtil.normalizeIdentifier(aliasedNode.getNode().getAlias());

Review Comment:
   Yes, this is used the same way as before, just gave a different name for it. 





> PQS / thin client doesn't distinguish between label and column_name
> -------------------------------------------------------------------
>
>                 Key: PHOENIX-6920
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6920
>             Project: Phoenix
>          Issue Type: Bug
>          Components: queryserver
>            Reporter: Istvan Toth
>            Assignee: Aron Attila Meszaros
>            Priority: Major
>
> While debugging PHOENIX-6917, I found that we receive the aliased column name 
> in both the _column_name_ and _label_ fields of the column metadata in 
> protobuf.
> This happened with PQS head and Phoenix 5.2.0-SNAPSHOT.
> Apparently, some older version used to work correctly (and returned the 
> unaliased name in {_}column_name{_})
> We need to check if this is a Phoenix or Avatica regression first, then fix 
> it in the appropriate project.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to