This seems to be a bug in the query planner. I could re-produce this
problem, with similar query, even on 1.4 and 1.5.

select rtrim(s.name2) as name3
from (
  select
    ltrim(n_name) as `name2`,
    count(*) as num_creates
  from cp.`tpch/nation.parquet`
  group by ltrim(n_name)
  order by name2 ASC
) s limit 100

Error: SYSTEM ERROR: AssertionError: Internal error: Type
'RecordType(ANY $f0, BIGINT num_creates)' has no field 'name2'

Could you please open a JIRA? Thanks.



On Fri, Apr 1, 2016 at 4:53 PM, John Omernik <[email protected]> wrote:
> This may be from traveling all day, but I am running the query below and
> the error, I think it should work with the subquery, but yet, it is
> failing. This is via JDBC
>
>
> select date_part('year', s.cdate) as ydate from (
> select
> to_date(createdon, 'yyyy-MM-dd HH:mm:ss') as `cdate`, count(*) as
> num_creates
> from
> view_mytable
> where
> createdon <> '0000-00-00 00:00:00' and createdon >= '2010-01-10'
> group by
> to_date(createdon, 'yyyy-MM-dd HH:mm:ss')
> order by cdate ASC
> ) s limit 100
>
> SYSTEM ERROR: AssertionError: Internal error: Type 'RecordType(ANY $f0,
> BIGINT num_creates)' has no field 'cdate'
> [Error Id: 50caacaf-0b9b-4c1c-a3e1-53248bc385c0 on
> hadoopmapr6.brewingintel.com:31010]
>
> It's like my alias for the grouped field isn't actually taking.... this
> seems odd to me, or am I just really doing something weird here?

Reply via email to