You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Abdel Hakim Deneche <ad...@maprtech.com> on 2015/04/30 17:58:18 UTC

should order by on non existing field fail ?

When running the following query, where the field "dummy" doesn't exist:

select o_orderkey, o_custkey from `tpch0.01/orders` order by dummy limit 5;
I get the following result:

> +------------+------------+
> | o_orderkey | o_custkey  |
> +------------+------------+
> | 2          | 781        |
> | 3          | 1234       |
> | 4          | 1369       |
> | 5          | 445        |
> | 1          | 370        |
> +------------+------------+

Is this a bug ? shouldn't the query fail instead ?

If the user makes a mistake and writes a wrong field name, the query will
still run and the user may not notice the results are actually not sorted
properly.

Thanks!


-- 

Abdelhakim Deneche

Software Engineer

  <http://www.mapr.com/>


Now Available - Free Hadoop On-Demand Training
<http://www.mapr.com/training?utm_source=Email&utm_medium=Signature&utm_campaign=Free%20available>

Re: should order by on non existing field fail ?

Posted by Jacques Nadeau <ja...@apache.org>.
That is currently how Drill operates.  This is a general behavior: we don't
know whether the last row will have the field so we can't fail until the
query has read all data.  That being said, since sort is blocking
operation, it would be nice to fail out early.

On Thu, Apr 30, 2015 at 8:58 AM, Abdel Hakim Deneche <ad...@maprtech.com>
wrote:

> When running the following query, where the field "dummy" doesn't exist:
>
> select o_orderkey, o_custkey from `tpch0.01/orders` order by dummy limit 5;
> I get the following result:
>
> > +------------+------------+
> > | o_orderkey | o_custkey  |
> > +------------+------------+
> > | 2          | 781        |
> > | 3          | 1234       |
> > | 4          | 1369       |
> > | 5          | 445        |
> > | 1          | 370        |
> > +------------+------------+
>
> Is this a bug ? shouldn't the query fail instead ?
>
> If the user makes a mistake and writes a wrong field name, the query will
> still run and the user may not notice the results are actually not sorted
> properly.
>
> Thanks!
>
>
> --
>
> Abdelhakim Deneche
>
> Software Engineer
>
>   <http://www.mapr.com/>
>
>
> Now Available - Free Hadoop On-Demand Training
> <
> http://www.mapr.com/training?utm_source=Email&utm_medium=Signature&utm_campaign=Free%20available
> >
>