[
https://issues.apache.org/jira/browse/DRILL-2361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14362654#comment-14362654
]
Aman Sinha commented on DRILL-2361:
-----------------------------------
[~dragoncurve] were you planning to update the patch or should I go ahead with
committing the current one? I found the following queries generate the same
error - the first one is for a sort operator, second with joins.
{code}
0: jdbc:drill:zk=local> select o_custkey as `x.y.z` from orders where
o_orderkey < 5 order by `x.y.z`;
Query failed: UnsupportedOperationException: Field references must be singular
names.
0: jdbc:drill:zk=local> select 1 from (select o_custkey as `x.y` from orders) o
inner join customer c on o.`x.y` = c.c_custkey;
Query failed: UnsupportedOperationException: Field references must be singular
names.
{code}
Like Jacques suggested, I can create a separate to track the issue in general.
> Column aliases cannot include dots
> ----------------------------------
>
> Key: DRILL-2361
> URL: https://issues.apache.org/jira/browse/DRILL-2361
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Affects Versions: 0.7.0, 0.8.0
> Reporter: Adam Gilmore
> Assignee: Aman Sinha
> Priority: Minor
> Attachments: DRILL-2361.1.patch.txt
>
>
> The Drill query engine rejects column aliases for aggregates or group by
> fields where the alias includes a dot.
> For example:
> {code}select count(*) as `test.field` from cp.`employee.json`;{code}
> throws an error with "Field references must be singular names."
> Having reviewed the code, I can't quite see a reason for it, and when using
> FieldReference.getWithQuotedRef instead in AggPrelBase, the issue is
> alleviated with no visible side effects.
> I'm sure there was a reason for this code in FieldReference, but I can't seem
> to work out why, and it seems entirely reasonable to allow a dot in a column
> alias.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)