Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill >> mail # dev >> ReferenceInterpreter Issue


Copy link to this message
-
RE: ReferenceInterpreter Issue
I just made few changes to the logical plan, and its working now.
It passes the test case well.

Changes made:
- Removed do [  ]  step
- Added id's and input's for each step
- Added output prefix to project step

Let me know if this helps.

-Yash

*******************************************************************************
LOGICAL PLAN: simple_plan.json
*******************************************************************************

{
  head:{
    type:"APACHE_DRILL_LOGICAL",
    version:"1",
    generator:{
      type:"manual",
      info:"na"
    }
  },
  storage:{
    console: {type: "console"},
    fs1: {type: "fs", root:"file:///"},
    cp: {type: "classpath"}
  },
  query:[

                {
                  @id:"1",
                  op: "scan",
                  memo: "initial_scan",
                  ref: "donuts",
                  storageengine: "cp",
                  selection: {
                    path: "/donuts.json",
                    type: "JSON"
                  }
                },
        {
                  @id:"2",
                  input:"1",
                  op: "transform",
                  transforms: [
                    { ref: "quantity", expr: "donuts.sales"}
                  ]
                },
                {
                  @id:"3",
                  input:"2",
                  op: "filter",
                  expr: "donuts.ppu < 1.00"
                },
                {
                  @id:"4",
                  input:"3",
                  op: "segment",
                  ref: "ppusegment",
                  exprs: ["donuts.ppu"]
                },
                {
                  @id:"5",
                  input:"4",
                  op: "collapsingaggregate",
                  within: "ppusegment",
                  carryovers: ["donuts.ppu"],
                  aggregations: [
                    { ref: "donuts.typeCount",  expr: "count(1)" },
                    { ref: "donuts.quantity",  expr: "sum(quantity)" },
                    { ref: "donuts.sales",  expr: "sum(donuts.ppu * quantity)" }
                  ]
                },
                {
                  @id:"6",
                  input:"5",
                  op: "order",
                  orderings: [
                    {order: "DESC", expr: "donuts.ppu" }
                  ]
                },
                {
                  @id:"7",
                  input:"6",
                  op: "project",
                  projections: [
                    { ref: "output.output", expr: "donuts" }
                  ]
                },
               {
          @id:"8",
                  input:"7",
                  op: "limit",
          first: 0,
          last: 100
        },
                {
                  @id:"9",
                  input:"8",
                  op: "store",
                  memo: "output sink",
                  storageengine: "console",
                  target: {pipe: "STD_OUT"}
                }
  ]
}

*******************************************************************************
OUTPUT
*******************************************************************************
{
  "output" : {
    "sales" : 184.25,
    "typeCount" : 2,
    "quantity" : 335,
    "ppu" : 0.55
  }
}
 {
  "output" : {
    "sales" : 109.71,
    "typeCount" : 2,
    "quantity" : 159,
    "ppu" : 0.69
  }
}

Thanks,
Yash Sharma

[impetus logo]

From: shrinidhi chaudhari [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 18, 2013 9:55 AM
To: drill-dev
Subject: Re: ReferenceInterpreter Issue

Hi Tim,
The plan loaded ($DRILL_SRC/exec/ref/src/test/resources/simple_plan.json) has a logical ops sequence.

// planString is correctly read, with a op sequence, file attached.
planString = Files.toString(new File(jsonFile), Charsets.UTF_8);
// the plan is not parsed from the string correctly
LogicalPlan plan = LogicalPlan.parse(config, planString);
Thanks,
Shrinidhi.
On Fri, Oct 18, 2013 at 2:44 AM, Timothy Chen <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:
Hi Shrinidi,

This logical plan has no logical operators (ie: Scan, Project, Store), so
it won't perform any action.

If you look at other logical plans in our tests, you can see examples where
we're loading from files and performing querying on those.

Can you show us what simple_plan.json you're using?

Tim
On Thu, Oct 17, 2013 at 1:26 PM, shrinidhi chaudhari <
[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:
Shrinidhi Chaudhari.

________________________________
NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB