incubator-drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Pernsteiner <apernstei...@maprtech.com>
Subject Re: Joining two views yields: You tried to do a batch data read operation when you were in a state of STOP
Date Sun, 03 Aug 2014 18:10:32 GMT
Here's what I did in order to get to this state:

1) dumped a JSON file (I attached a small snippet) into a folder
2) created a view based on that file:

 create view click.`json_large`.`myview` as
 select t.trans_id, t.user_info.cust_id as cust_id,
 t.user_info.device as device, t.user_info.state as state,
 t.marketing_info.camp_id as camp_id, t.marketing_info.keywords as
keywords,
 t.trans_info.prod_id as prod_id, t.trans_info.purch_flag as purch_flag
from
 click.`json_large`.`/mobile.json` t;

(note that the select statement does in fact work)

3) Created an HBASE table (script and .csv input file attached)

4) Created a view based on the HBASE table:

create view click.`views`.`prodview` as select cast (row_key as int) as
prod_id, cast
(h.details.name as varchar(20)) as name, cast
(h.details.category as varchar(20)) as category, cast
(h.pricing.price as varchar(20)) as price
 from
hbase.`products` h ;


5) tested each view independently:


JSON:

0: jdbc:drill:> select * from click.`views`.`logview` limit 3;
+------------+------------+------------+------------+------------+-------------+
|  trans_id  |  cust_id   |   device   |   state    |  camp_id   |
 keywords   |
+------------+------------+------------+------------+------------+-------------+
| 0          | 4          | AOS4.4     | mn         | 8          | []
   |
| 1          | 12777      | AOS4.3     | ny         | 1          |
["father's" |
| 2          | 8          | IOS5       | ny         | 3          |
["to","him" |
+------------+------------+------------+------------+------------+-------------+
3 rows selected (0.299 seconds)

HBASE:

0: jdbc:drill:> select * from click.`views`.`prodview` limit 1;
+------------+------------+------------+------------+
|  prod_id   |    name    |  category  |   price    |
+------------+------------+------------+------------+
| 1          | #10-4 1/8 x 9 1/2 Pr | Envelopes  | 16         |
+------------+------------+------------+------------+
1 row selected (0.357 seconds)


6) tested a simple join:

select trans_id
from click.`views`.`logview` logs
INNER JOIN click.`views`.`prodview` prods
on ( logs.`prod_id` = prods.`prod_id`)
limit 10;

got a failure:

Query failed: Failure while running fragment. You tried to do a batch data
read operation when you were in a state of STOP.  You can only do this type
of operation when you are in a state of OK or OK_NEW_SCHEMA.
[2b5ff484-12ce-4553-9ebe-1326bba8b3f5]

Error: exception while executing query: Failure while trying to get next
result batch. (state=,code=0)





On Fri, Aug 1, 2014 at 9:21 PM, Venkata Sowrirajan <vsowrirajan@maprtech.com
> wrote:

> I think OK and OK_NEW_SCHEMA are basically to track the schema of the data
> to make sure it is still the same schema or the schema changes when it does
> record batches. But as far as why its happening, I am not sure. May be I
> can try reproducing it and see why its happening?
>
> Regards
>
> Venkat
> MapR Technologies, Inc.
>
>
> On Fri, Aug 1, 2014 at 3:40 PM, Andy Pernsteiner <
> apernsteiner@maprtech.com>
> wrote:
>
> > The query below yields an interesting error I'd not seen before.
>  Basically
> > I'm re-creating a query which Tableau tried to execute against a pair of
> > drill-created views.
> >
> > Not clear on what 'OK' or 'OK_NEW_SCHEMA' refer to in this context..is
> > there a way for me to solve this?
> >
> >
> >
> >
> > 0: jdbc:drill:>  SELECT `logview`.`camp_id` AS `none_camp_id_ok`,
> > . . . . . . . >   `prodview`.`category` AS `none_category_nk`
> > . . . . . . . > FROM `click`.`views`.`logview` `logview`
> > . . . . . . . >   INNER JOIN `click`.`views`.`prodview` `prodview` ON
> > (`logview`.`prod_id` = `prodview`.`prod_id`)
> > . . . . . . . > GROUP BY `logview`.`camp_id`,
> > . . . . . . . >   `prodview`.`category` ;
> > *Query failed: Failure while running fragment. You tried to do a batch
> data
> > read operation when you were in a state of STOP.  You can only do this
> type
> > of operation when you are in a state of OK or OK_NEW_SCHEMA.
> > [6b5ceaab-2594-40fe-81be-b52a07ced155]*
> > Node details: ip-172-16-1-111:31011/31012
> > java.lang.IllegalStateException: You tried to do a batch data read
> > operation when you were in a state of STOP.  You can only do this type of
> > operation when you are in a state of OK or OK_NEW_SCHEMA.
> > at
> >
> >
> org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.validateReadState(IteratorValidatorBatchIterator.java:54)
> > at
> >
> >
> org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.iterator(IteratorValidatorBatchIterator.java:64)
> > at
> >
> >
> org.apache.drill.exec.test.generated.HashJoinProbeGen221.executeProbePhase(HashJoinProbeTemplate.java:116)
> > at
> >
> >
> org.apache.drill.exec.test.generated.HashJoinProbeGen221.probeAndProject(HashJoinProbeTemplate.java:246)
> > at
> >
> >
> org.apache.drill.exec.physical.impl.join.HashJoinBatch.innerNext(HashJoinBatch.java:212)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:95)
> > at
> >
> >
> org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next(IteratorValidatorBatchIterator.java:116)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:75)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:65)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:45)
> > at
> >
> >
> org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext(ProjectRecordBatch.java:120)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:95)
> > at
> >
> >
> org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next(IteratorValidatorBatchIterator.java:116)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:75)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:65)
> > at
> >
> >
> org.apache.drill.exec.physical.impl.aggregate.HashAggBatch.innerNext(HashAggBatch.java:101)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:95)
> > at
> >
> >
> org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next(IteratorValidatorBatchIterator.java:116)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:75)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:65)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:45)
> > at
> >
> >
> org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext(ProjectRecordBatch.java:120)
> > at
> >
> >
> org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:95)
> > at
> >
> >
> org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next(IteratorValidatorBatchIterator.java:116)
> > at
> >
> org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:59)
> > at
> >
> >
> org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext(ScreenCreator.java:98)
> > at
> >
> org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:49)
> > at
> >
> >
> org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:116)
> > at
> >
> >
> org.apache.drill.exec.work.WorkManager$RunnableWrapper.run(WorkManager.java:250)
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> > at java.lang.Thread.run(Thread.java:745)
> >
> >
> > Error: exception while executing query: Failure while trying to get next
> > result batch. (state=,code=0)
> >
> >
> > --
> >  Andy Pernsteiner
> >  Manager, Field Enablement
> > ph: 206.228.0737
> >
> > www.mapr.com
> >
>



-- 
 Andy Pernsteiner
 Manager, Field Enablement
ph: 206.228.0737

www.mapr.com

Mime
View raw message