You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by John Omernik <jo...@omernik.com> on 2016/04/02 01:53:56 UTC

Quick Query help

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?

Re: Quick Query help

Posted by Jinfeng Ni <ji...@gmail.com>.
Thanks for filing the jira. I add the comment to JIRA.

I'm also surprised that we did not hit this bug before.  It seems to
be related to the functions in the query.



On Fri, Apr 1, 2016 at 5:44 PM, John Omernik <jo...@omernik.com> wrote:
> (By the way, thank you for validating, I apologize for not mentioning that.
> It is appreciated)
>
> John
>
> On Fri, Apr 1, 2016 at 7:43 PM, John Omernik <jo...@omernik.com> wrote:
>
>> Done.
>>
>> https://issues.apache.org/jira/browse/DRILL-4572
>>
>> Can you add your comment to the JIRA please? This seems like an odd bug,
>> and I am surprised it hasn't come up, is using the results of functions as
>> the aggregate field a rarity in Drill?
>>
>> On Fri, Apr 1, 2016 at 7:35 PM, Jinfeng Ni <ji...@gmail.com> wrote:
>>
>>> 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 <jo...@omernik.com> 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?
>>>
>>
>>

Re: Quick Query help

Posted by John Omernik <jo...@omernik.com>.
(By the way, thank you for validating, I apologize for not mentioning that.
It is appreciated)

John

On Fri, Apr 1, 2016 at 7:43 PM, John Omernik <jo...@omernik.com> wrote:

> Done.
>
> https://issues.apache.org/jira/browse/DRILL-4572
>
> Can you add your comment to the JIRA please? This seems like an odd bug,
> and I am surprised it hasn't come up, is using the results of functions as
> the aggregate field a rarity in Drill?
>
> On Fri, Apr 1, 2016 at 7:35 PM, Jinfeng Ni <ji...@gmail.com> wrote:
>
>> 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 <jo...@omernik.com> 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?
>>
>
>

Re: Quick Query help

Posted by John Omernik <jo...@omernik.com>.
Done.

https://issues.apache.org/jira/browse/DRILL-4572

Can you add your comment to the JIRA please? This seems like an odd bug,
and I am surprised it hasn't come up, is using the results of functions as
the aggregate field a rarity in Drill?

On Fri, Apr 1, 2016 at 7:35 PM, Jinfeng Ni <ji...@gmail.com> wrote:

> 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 <jo...@omernik.com> 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?
>

Re: Quick Query help

Posted by Jinfeng Ni <ji...@gmail.com>.
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 <jo...@omernik.com> 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?