Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Drill, mail # dev - Exception running order by in sqline


+
Timothy Chen 2013-09-04, 17:55
+
Jacques Nadeau 2013-09-04, 18:04
+
Timothy Chen 2013-09-04, 18:39
+
Jacques Nadeau 2013-09-04, 18:53
+
Ted Dunning 2013-09-04, 19:02
+
Jacques Nadeau 2013-09-04, 19:42
+
Timothy Chen 2013-09-04, 20:03
+
Timothy Chen 2013-09-04, 20:15
+
Jacques Nadeau 2013-09-04, 20:59
Copy link to this message
-
Re: Exception running order by in sqline
Timothy Chen 2013-09-04, 22:33
Hi Jacques,

Do you know what query with order by will work using the sample data? I'm
trying to find one that can actually work.

Tim
On Wed, Sep 4, 2013 at 1:59 PM, Jacques Nadeau <[EMAIL PROTECTED]> wrote:

> In the plan here, the problem is this:
>
>  { order : "asc", expr : "_MAP", nullCollation : "NULLS_LAST" }
>
> Two issues: there is no such thing as ordering by a map.  Additionally, we
> don't support direct map references yet.
>
> What query were these plans for?  We need to make sure everybody has the
> same expectation of output.
>
> J
>
>
> On Wed, Sep 4, 2013 at 1:03 PM, Timothy Chen <[EMAIL PROTECTED]> wrote:
>
> > Just as Ted pointed out I tried just columns and ordering by different
> > fields and none of them work.
> >
> > It fails on the tip of master too.
> >
> > Logical plan:
> >
> > Logical { head : { type : "APACHE_DRILL_LOGICAL", version : 1, generator
> :
> > { type : "optiq", info : "na" } }, storage : { parquet-local : { type :
> > "parquet", dfsName : "file:///" } }, query : [ { op : "scan", @id : 1,
> memo
> > : "initial_scan", storageengine : "parquet-local", selection : [ { path :
> > "sample-data/region.parquet" } ], ref : "_MAP" }, { op : "order", @id :
> 2,
> > input : 1, within : null, orderings : [ { order : "asc", expr : "_MAP",
> > nullCollation : "NULLS_LAST" } ] }, { op : "store", @id : 3, memo :
> "output
> > sink", input : 2, target : { number : 0 }, partition : null,
> storageEngine
> > : "queue" } ] }
> >
> > Physical plan:
> >
> > Physical { head : { type : "APACHE_DRILL_PHYSICAL", version : 1,
> generator
> > : { type : "optiq", info : "na" } }, graph : [ { pop : "parquet-scan",
> @id
> > : 1, entries : [ { path : "sample-data/region.parquet" } ], ref : "_MAP",
> > fragmentPointer : 0 }, { pop : "sort", @id : 2, child : 1, orderings : [
> {
> > order : "asc", expr : "_MAP" } ], reverse : false }, { pop :
> > "selection-vector-remover", @id : 3, child : 2 }, { pop : "screen", @id :
> > 4, child : 3 } ] }
> >
> > Tim
> >
> >
> > On Wed, Sep 4, 2013 at 12:42 PM, Jacques Nadeau <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Good point.  Do you want to take a look at the plans and see what are
> > pinch
> > > point is?
> > >
> > > J
> > > On Sep 4, 2013 12:03 PM, "Ted Dunning" <[EMAIL PROTECTED]> wrote:
> > >
> > > > Hmm... I don't understand the limitation.
> > > >
> > > > I also see these:
> > > >
> > > > *fails*:
> > > >
> > > > select _MAP['REGION_KEY'] from "sample-data/nation.parquet"
> > > > order by cast( _MAP['NATION_KEY'] as INTEGER);
> > > >
> > > >
> > > > *fails*: select _MAP['REGION_KEY'] from "sample-data/nation.parquet"
> > > order
> > > > by _MAP['NATION_KEY'];
> > > >
> > > >
> > > > *fails: *select _MAP['REGION_KEY'] from "sample-data/nation.parquet"
> > > order
> > > > by 1;
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Wed, Sep 4, 2013 at 11:53 AM, Jacques Nadeau <[EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > Two problems in this query.
> > > > >
> > > > > First is you're sorting by a map field.  We don't currently direct
> > map
> > > > > field expressions.  You need to qualify to a particular scalar or
> > > > repeated
> > > > > field.
> > > > >
> > > > > The second problem is that the current code requires resolution of
> a
> > > > field
> > > > > rather than using * when you're trying to reference it elsewhere.
> > > > >
> > > > > therefore:
> > > > > not supported: select * from "sample-data/region.parquet" order by
> 1
> > ;
> > > > (map
> > > > > keys are not currently referenceable and that is what this
> currently
> > > > means)
> > > > > not supported yet: select * from "sample-data/region.parquet" order
> > by
> > > > > _MAP['R_REGIONKEY'];  (known issue we should fix in m2 or m3)
> > > > > supported: select _MAP['R_REGIONKEY'] from
> > "sample-data/region.parquet"
> > > > > order by _MAP['R_REGIONKEY'];
> > > > >
> > > > >
> > > > >
> > > > > On Wed, Sep 4, 2013 at 11:39 AM, Timothy Chen <[EMAIL PROTECTED]>
> > > wrote:
> > > > >
> > > > >
+
Timothy Chen 2013-09-04, 22:39
+
Jacques Nadeau 2013-09-05, 23:04
+
Timothy Chen 2013-09-06, 00:07