Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-09 Thread Zelaine Fong
I believe Chunhui has a fix for DRILL-5089 but is waiting on the Calcite 
portions of the fix to be accepted.

-- Zelaine

On 3/9/17, 7:47 AM, "Jinfeng Ni" <j...@apache.org> wrote:

DRILL-5089 has hit many drill users for very long time; it was
reported several times on this drill user list. It would make sense to
bump it's priority and get it fixed in the next Drill release.


On Wed, Mar 8, 2017 at 8:45 AM, Zelaine Fong <zf...@mapr.com> wrote:
> The slowness you’re seeing when you have additional storage plugins that 
are not being used by your query is due to DRILL-5089.
>
> -- Zelaine
>
> On 3/7/17, 11:20 PM, "PROJJWAL SAHA" <proj.s...@gmail.com> wrote:
>
> Hi Kunal,
>
> Good catch ! Thanks for this pointer.
> I enabled logging at org.apache.drill level and I found -
>
> 2017-03-08 01:39:01,822 
[274058fa-79df-9c74-3219-3fcb83a04605:foreman] INFO
>  o.a.drill.exec.work.foreman.Foreman - Query text for query id
> 274058fa-79df-9c74-3219-3fcb83a04605: explain plan for select * from
> dfs.root.`/scratch/localdisk/drill/testdata/Cust_1G_20_tsv` where
> ORDER_ID='41' and CUSTOMER_ID='568'
> *2017-03-08 01:39:01,823 
[274058fa-79df-9c74-3219-3fcb83a04605:foreman]
> DEBUG o.a.d.e.s.h.HBaseStoragePluginConfig - Initializing HBase
> StoragePlugin configuration with zookeeper quorum 'localhost', port 
'2181'.*
> *2017-03-08 01:39:16,038 
[274058fa-79df-9c74-3219-3fcb83a04605:foreman]
> DEBUG o.a.drill.exec.store.SchemaFactory - Took 14214 ms to register
> schemas.*
>
>
> i am not sure why the hbase storage plugin comes in play as it is 
disabled.
> i then disabled all the other active plugins that i had and just kept 
the
> dfs plugin.
>
> the planning time is now reduced to 0.9 secs
> and the query time for 1GB partitioned tsv data is taking 3.63 secs
>
> is that a reasonable behaviour ?
>
> Regards,
> Projjwal
>
> On Wed, Mar 8, 2017 at 12:11 AM, Kunal Khatua <kkha...@mapr.com> 
wrote:
>
> >
> > Looking at the 1st two lines of the log shows that the bulk of time 
was
> > lost before the query even went into the real planning stage of the 
query:
> >
> >
> > 2017-03-07 06:27:28,074 
[274166de-f543-3fa7-ef9e-8e9e87d5d6a0:foreman]
> > INFO  o.a.drill.exec.work.foreman.Foreman - Query text for query id
> > 274166de-f543-3fa7-ef9e-8e9e87d5d6a0: select columns[0] from
> > dfs.root.`/scratch/localdisk/drill/testdata/Cust_1G_20_tsv` where
> > columns[0] ='41' and columns[3] ='568'
> > 2017-03-07 06:28:00,775 
[274166de-f543-3fa7-ef9e-8e9e87d5d6a0:foreman]
> > INFO  o.a.d.exec.store.dfs.FileSelection - 
FileSelection.getStatuses()
> > took 0 ms, numFiles: 1
> >
> >
> > More than 30 secs is unaccounted for. Can you turn on the root 
logger to
> > be at the debug level and retry the explain plan?
> >
    >     >
> > Kunal Khatua
    >     >
> >
> > 
> > From: rahul challapalli <challapallira...@gmail.com>
> > Sent: Tuesday, March 7, 2017 5:24:43 AM
> > To: user
> > Subject: Re: Minimise query plan time for dfs plugin for local file 
system
> > on tsv file
> >
> > I did not get a chance to review the log file.
> >
> > However the next thing I would try is to make your cluster a single 
node
> > cluster first and then run the same explain plan query separately 
on each
> > individual file.
> >
> >
> >
> > On Mar 7, 2017 5:09 AM, "PROJJWAL SAHA" <proj.s...@gmail.com> wrote:
> >
> > > Hi Rahul,
> > >
> > > thanks for your suggestions. However, I am still not able to see 
any
> > > reduction in query planning time
> > > by explicit column names, removing extract headers and using
> > columns[index]
> > >
> > > As I said, I ran explain plan and its taking 30+ secs for me.
> > > My data is 1 GB tsv split into 20 files of 5 MB each.
> > > Each 5MB file has close to 50k records
> > > Its a 5 node cluster, and width per node is 4
  

Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-09 Thread Jinfeng Ni
DRILL-5089 has hit many drill users for very long time; it was
reported several times on this drill user list. It would make sense to
bump it's priority and get it fixed in the next Drill release.


On Wed, Mar 8, 2017 at 8:45 AM, Zelaine Fong <zf...@mapr.com> wrote:
> The slowness you’re seeing when you have additional storage plugins that are 
> not being used by your query is due to DRILL-5089.
>
> -- Zelaine
>
> On 3/7/17, 11:20 PM, "PROJJWAL SAHA" <proj.s...@gmail.com> wrote:
>
> Hi Kunal,
>
> Good catch ! Thanks for this pointer.
> I enabled logging at org.apache.drill level and I found -
>
> 2017-03-08 01:39:01,822 [274058fa-79df-9c74-3219-3fcb83a04605:foreman] 
> INFO
>  o.a.drill.exec.work.foreman.Foreman - Query text for query id
> 274058fa-79df-9c74-3219-3fcb83a04605: explain plan for select * from
> dfs.root.`/scratch/localdisk/drill/testdata/Cust_1G_20_tsv` where
> ORDER_ID='41' and CUSTOMER_ID='568'
> *2017-03-08 01:39:01,823 [274058fa-79df-9c74-3219-3fcb83a04605:foreman]
> DEBUG o.a.d.e.s.h.HBaseStoragePluginConfig - Initializing HBase
> StoragePlugin configuration with zookeeper quorum 'localhost', port 
> '2181'.*
> *2017-03-08 01:39:16,038 [274058fa-79df-9c74-3219-3fcb83a04605:foreman]
> DEBUG o.a.drill.exec.store.SchemaFactory - Took 14214 ms to register
> schemas.*
>
>
> i am not sure why the hbase storage plugin comes in play as it is 
> disabled.
> i then disabled all the other active plugins that i had and just kept the
> dfs plugin.
>
> the planning time is now reduced to 0.9 secs
> and the query time for 1GB partitioned tsv data is taking 3.63 secs
>
> is that a reasonable behaviour ?
>
> Regards,
> Projjwal
>
> On Wed, Mar 8, 2017 at 12:11 AM, Kunal Khatua <kkha...@mapr.com> wrote:
>
> >
> > Looking at the 1st two lines of the log shows that the bulk of time was
> > lost before the query even went into the real planning stage of the 
> query:
> >
> >
> > 2017-03-07 06:27:28,074 [274166de-f543-3fa7-ef9e-8e9e87d5d6a0:foreman]
> > INFO  o.a.drill.exec.work.foreman.Foreman - Query text for query id
> > 274166de-f543-3fa7-ef9e-8e9e87d5d6a0: select columns[0] from
> > dfs.root.`/scratch/localdisk/drill/testdata/Cust_1G_20_tsv` where
> > columns[0] ='41' and columns[3] ='568'
> > 2017-03-07 06:28:00,775 [274166de-f543-3fa7-ef9e-8e9e87d5d6a0:foreman]
> > INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses()
> > took 0 ms, numFiles: 1
> >
> >
> > More than 30 secs is unaccounted for. Can you turn on the root logger to
> > be at the debug level and retry the explain plan?
>     >
>     >
> > Kunal Khatua
>     >
> >
> > 
> > From: rahul challapalli <challapallira...@gmail.com>
> > Sent: Tuesday, March 7, 2017 5:24:43 AM
> > To: user
> > Subject: Re: Minimise query plan time for dfs plugin for local file 
> system
> > on tsv file
> >
> > I did not get a chance to review the log file.
> >
> > However the next thing I would try is to make your cluster a single node
> > cluster first and then run the same explain plan query separately on 
> each
> > individual file.
> >
> >
> >
> > On Mar 7, 2017 5:09 AM, "PROJJWAL SAHA" <proj.s...@gmail.com> wrote:
> >
> > > Hi Rahul,
> > >
> > > thanks for your suggestions. However, I am still not able to see any
> > > reduction in query planning time
> > > by explicit column names, removing extract headers and using
> > columns[index]
> > >
> > > As I said, I ran explain plan and its taking 30+ secs for me.
> > > My data is 1 GB tsv split into 20 files of 5 MB each.
> > > Each 5MB file has close to 50k records
> > > Its a 5 node cluster, and width per node is 4
> > > Therefore, total number of minor fragments for one major fragment is 
> 20
> > > I have copied the source directory in all the drillbit nodes
> > >
> > > can you tell me a reasonable time estimate which I can expect drill to
> > > return result for query for the above described scenario.
> > > Query is - select columns[0] from dfs.root.`/scratch/localdisk/
> > drill/testdata/Cust_1G_20_tsv`
> > > where columns[0] ='41' and columns[3] ='568'
> > >
> 

Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-08 Thread Zelaine Fong
The slowness you’re seeing when you have additional storage plugins that are 
not being used by your query is due to DRILL-5089.

-- Zelaine

On 3/7/17, 11:20 PM, "PROJJWAL SAHA" <proj.s...@gmail.com> wrote:

Hi Kunal,

Good catch ! Thanks for this pointer.
I enabled logging at org.apache.drill level and I found -

2017-03-08 01:39:01,822 [274058fa-79df-9c74-3219-3fcb83a04605:foreman] INFO
 o.a.drill.exec.work.foreman.Foreman - Query text for query id
274058fa-79df-9c74-3219-3fcb83a04605: explain plan for select * from
dfs.root.`/scratch/localdisk/drill/testdata/Cust_1G_20_tsv` where
ORDER_ID='41' and CUSTOMER_ID='568'
*2017-03-08 01:39:01,823 [274058fa-79df-9c74-3219-3fcb83a04605:foreman]
DEBUG o.a.d.e.s.h.HBaseStoragePluginConfig - Initializing HBase
StoragePlugin configuration with zookeeper quorum 'localhost', port '2181'.*
*2017-03-08 01:39:16,038 [274058fa-79df-9c74-3219-3fcb83a04605:foreman]
DEBUG o.a.drill.exec.store.SchemaFactory - Took 14214 ms to register
schemas.*


i am not sure why the hbase storage plugin comes in play as it is disabled.
i then disabled all the other active plugins that i had and just kept the
dfs plugin.

the planning time is now reduced to 0.9 secs
and the query time for 1GB partitioned tsv data is taking 3.63 secs

is that a reasonable behaviour ?

Regards,
Projjwal

On Wed, Mar 8, 2017 at 12:11 AM, Kunal Khatua <kkha...@mapr.com> wrote:

>
> Looking at the 1st two lines of the log shows that the bulk of time was
> lost before the query even went into the real planning stage of the query:
>
>
> 2017-03-07 06:27:28,074 [274166de-f543-3fa7-ef9e-8e9e87d5d6a0:foreman]
> INFO  o.a.drill.exec.work.foreman.Foreman - Query text for query id
> 274166de-f543-3fa7-ef9e-8e9e87d5d6a0: select columns[0] from
> dfs.root.`/scratch/localdisk/drill/testdata/Cust_1G_20_tsv` where
> columns[0] ='41' and columns[3] ='568'
> 2017-03-07 06:28:00,775 [274166de-f543-3fa7-ef9e-8e9e87d5d6a0:foreman]
> INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses()
> took 0 ms, numFiles: 1
>
>
> More than 30 secs is unaccounted for. Can you turn on the root logger to
> be at the debug level and retry the explain plan?
>
>
> Kunal Khatua
>
>
> 
> From: rahul challapalli <challapallira...@gmail.com>
> Sent: Tuesday, March 7, 2017 5:24:43 AM
    > To: user
> Subject: Re: Minimise query plan time for dfs plugin for local file system
> on tsv file
>
> I did not get a chance to review the log file.
>
> However the next thing I would try is to make your cluster a single node
> cluster first and then run the same explain plan query separately on each
> individual file.
>
>
>
> On Mar 7, 2017 5:09 AM, "PROJJWAL SAHA" <proj.s...@gmail.com> wrote:
>
> > Hi Rahul,
> >
> > thanks for your suggestions. However, I am still not able to see any
> > reduction in query planning time
> > by explicit column names, removing extract headers and using
> columns[index]
> >
> > As I said, I ran explain plan and its taking 30+ secs for me.
> > My data is 1 GB tsv split into 20 files of 5 MB each.
> > Each 5MB file has close to 50k records
> > Its a 5 node cluster, and width per node is 4
> > Therefore, total number of minor fragments for one major fragment is 20
> > I have copied the source directory in all the drillbit nodes
> >
> > can you tell me a reasonable time estimate which I can expect drill to
> > return result for query for the above described scenario.
> > Query is - select columns[0] from dfs.root.`/scratch/localdisk/
> drill/testdata/Cust_1G_20_tsv`
> > where columns[0] ='41' and columns[3] ='568'
> >
> > attached is the json profile
> > and the drillbit.log
> >
> > I also have the tracing enabled.
> > org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler
> > org.apache.drill.exec.work.foreman.Foreman
> > however i see the duration of various steps in the order of ms in the
> logs.
> > i am not sure where planning time of the order of 30 secs is consumed.
> >
> > Please help
> >
> > Regards,
> > Projjwal
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Mar 6, 2017 at 11:23 PM, rahul challapalli <
> > challapallira...

Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-07 Thread PROJJWAL SAHA
Hi Kunal,

Good catch ! Thanks for this pointer.
I enabled logging at org.apache.drill level and I found -

2017-03-08 01:39:01,822 [274058fa-79df-9c74-3219-3fcb83a04605:foreman] INFO
 o.a.drill.exec.work.foreman.Foreman - Query text for query id
274058fa-79df-9c74-3219-3fcb83a04605: explain plan for select * from
dfs.root.`/scratch/localdisk/drill/testdata/Cust_1G_20_tsv` where
ORDER_ID='41' and CUSTOMER_ID='568'
*2017-03-08 01:39:01,823 [274058fa-79df-9c74-3219-3fcb83a04605:foreman]
DEBUG o.a.d.e.s.h.HBaseStoragePluginConfig - Initializing HBase
StoragePlugin configuration with zookeeper quorum 'localhost', port '2181'.*
*2017-03-08 01:39:16,038 [274058fa-79df-9c74-3219-3fcb83a04605:foreman]
DEBUG o.a.drill.exec.store.SchemaFactory - Took 14214 ms to register
schemas.*


i am not sure why the hbase storage plugin comes in play as it is disabled.
i then disabled all the other active plugins that i had and just kept the
dfs plugin.

the planning time is now reduced to 0.9 secs
and the query time for 1GB partitioned tsv data is taking 3.63 secs

is that a reasonable behaviour ?

Regards,
Projjwal

On Wed, Mar 8, 2017 at 12:11 AM, Kunal Khatua <kkha...@mapr.com> wrote:

>
> Looking at the 1st two lines of the log shows that the bulk of time was
> lost before the query even went into the real planning stage of the query:
>
>
> 2017-03-07 06:27:28,074 [274166de-f543-3fa7-ef9e-8e9e87d5d6a0:foreman]
> INFO  o.a.drill.exec.work.foreman.Foreman - Query text for query id
> 274166de-f543-3fa7-ef9e-8e9e87d5d6a0: select columns[0] from
> dfs.root.`/scratch/localdisk/drill/testdata/Cust_1G_20_tsv` where
> columns[0] ='41' and columns[3] ='568'
> 2017-03-07 06:28:00,775 [274166de-f543-3fa7-ef9e-8e9e87d5d6a0:foreman]
> INFO  o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses()
> took 0 ms, numFiles: 1
>
>
> More than 30 secs is unaccounted for. Can you turn on the root logger to
> be at the debug level and retry the explain plan?
>
>
> Kunal Khatua
>
>
> 
> From: rahul challapalli <challapallira...@gmail.com>
> Sent: Tuesday, March 7, 2017 5:24:43 AM
> To: user
> Subject: Re: Minimise query plan time for dfs plugin for local file system
> on tsv file
>
> I did not get a chance to review the log file.
>
> However the next thing I would try is to make your cluster a single node
> cluster first and then run the same explain plan query separately on each
> individual file.
>
>
>
> On Mar 7, 2017 5:09 AM, "PROJJWAL SAHA" <proj.s...@gmail.com> wrote:
>
> > Hi Rahul,
> >
> > thanks for your suggestions. However, I am still not able to see any
> > reduction in query planning time
> > by explicit column names, removing extract headers and using
> columns[index]
> >
> > As I said, I ran explain plan and its taking 30+ secs for me.
> > My data is 1 GB tsv split into 20 files of 5 MB each.
> > Each 5MB file has close to 50k records
> > Its a 5 node cluster, and width per node is 4
> > Therefore, total number of minor fragments for one major fragment is 20
> > I have copied the source directory in all the drillbit nodes
> >
> > can you tell me a reasonable time estimate which I can expect drill to
> > return result for query for the above described scenario.
> > Query is - select columns[0] from dfs.root.`/scratch/localdisk/
> drill/testdata/Cust_1G_20_tsv`
> > where columns[0] ='41' and columns[3] ='568'
> >
> > attached is the json profile
> > and the drillbit.log
> >
> > I also have the tracing enabled.
> > org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler
> > org.apache.drill.exec.work.foreman.Foreman
> > however i see the duration of various steps in the order of ms in the
> logs.
> > i am not sure where planning time of the order of 30 secs is consumed.
> >
> > Please help
> >
> > Regards,
> > Projjwal
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Mar 6, 2017 at 11:23 PM, rahul challapalli <
> > challapallira...@gmail.com> wrote:
> >
> >> You can try the below things. For each of the below check the planning
> >> time
> >> individually
> >>
> >> 1. Run explain plan for a simple "select * from `
> >> /scratch/localdisk/drill/testdata/Cust_1G_tsv`"
> >> 2. Replace the '*' in your query with explicit column names
> >> 3. Remove the extract header from your storage plugin configuration and
> >> from your data files? Rewrite your query to use, columns[0_based_index]
> >> instead of explicit column names
> >>
> >> Also how many columns do you have in your text files and 

Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-07 Thread Kunal Khatua

Looking at the 1st two lines of the log shows that the bulk of time was lost 
before the query even went into the real planning stage of the query:


2017-03-07 06:27:28,074 [274166de-f543-3fa7-ef9e-8e9e87d5d6a0:foreman] INFO  
o.a.drill.exec.work.foreman.Foreman - Query text for query id 
274166de-f543-3fa7-ef9e-8e9e87d5d6a0: select columns[0] from 
dfs.root.`/scratch/localdisk/drill/testdata/Cust_1G_20_tsv` where columns[0] 
='41' and columns[3] ='568'
2017-03-07 06:28:00,775 [274166de-f543-3fa7-ef9e-8e9e87d5d6a0:foreman] INFO  
o.a.d.exec.store.dfs.FileSelection - FileSelection.getStatuses() took 0 ms, 
numFiles: 1


More than 30 secs is unaccounted for. Can you turn on the root logger to be at 
the debug level and retry the explain plan?


Kunal Khatua



From: rahul challapalli <challapallira...@gmail.com>
Sent: Tuesday, March 7, 2017 5:24:43 AM
To: user
Subject: Re: Minimise query plan time for dfs plugin for local file system on 
tsv file

I did not get a chance to review the log file.

However the next thing I would try is to make your cluster a single node
cluster first and then run the same explain plan query separately on each
individual file.



On Mar 7, 2017 5:09 AM, "PROJJWAL SAHA" <proj.s...@gmail.com> wrote:

> Hi Rahul,
>
> thanks for your suggestions. However, I am still not able to see any
> reduction in query planning time
> by explicit column names, removing extract headers and using columns[index]
>
> As I said, I ran explain plan and its taking 30+ secs for me.
> My data is 1 GB tsv split into 20 files of 5 MB each.
> Each 5MB file has close to 50k records
> Its a 5 node cluster, and width per node is 4
> Therefore, total number of minor fragments for one major fragment is 20
> I have copied the source directory in all the drillbit nodes
>
> can you tell me a reasonable time estimate which I can expect drill to
> return result for query for the above described scenario.
> Query is - select columns[0] from 
> dfs.root.`/scratch/localdisk/drill/testdata/Cust_1G_20_tsv`
> where columns[0] ='41' and columns[3] ='568'
>
> attached is the json profile
> and the drillbit.log
>
> I also have the tracing enabled.
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler
> org.apache.drill.exec.work.foreman.Foreman
> however i see the duration of various steps in the order of ms in the logs.
> i am not sure where planning time of the order of 30 secs is consumed.
>
> Please help
>
> Regards,
> Projjwal
>
>
>
>
>
>
>
> On Mon, Mar 6, 2017 at 11:23 PM, rahul challapalli <
> challapallira...@gmail.com> wrote:
>
>> You can try the below things. For each of the below check the planning
>> time
>> individually
>>
>> 1. Run explain plan for a simple "select * from `
>> /scratch/localdisk/drill/testdata/Cust_1G_tsv`"
>> 2. Replace the '*' in your query with explicit column names
>> 3. Remove the extract header from your storage plugin configuration and
>> from your data files? Rewrite your query to use, columns[0_based_index]
>> instead of explicit column names
>>
>> Also how many columns do you have in your text files and what is the size
>> of each file? Like gautam suggested, it would be good to take a look at
>> drillbit.log file (from the foreman node where planning occurred) and the
>> query profile as well.
>>
>> - Rahul
>>
>> On Mon, Mar 6, 2017 at 9:30 AM, Gautam Parai <gpa...@mapr.com> wrote:
>>
>> > Can you please provide the drillbit.log file?
>> >
>> >
>> > Gautam
>> >
>> > 
>> > From: PROJJWAL SAHA <proj.s...@gmail.com>
>> > Sent: Monday, March 6, 2017 1:45:38 AM
>> > To: user@drill.apache.org
>> > Subject: Fwd: Minimise query plan time for dfs plugin for local file
>> > system on tsv file
>> >
>> > all, please help me in giving suggestions on what areas i can look into
>> > why the query planning time is taking so long for files which are local
>> to
>> > the drill machines. I have the same directory structure copied on all
>> the 5
>> > nodes of the cluster. I am accessing the source files using out of the
>> box
>> > dfs storage plugin.
>> >
>> > Query planning time is approx 30 secs
>> > Query execution time is apprx 1.5 secs
>> >
>> > Regards,
>> > Projjwal
>> >
>> > -- Forwarded message --
>> > From: PROJJWAL SAHA <proj.s...@gmail.com<mailto:proj.s...@gmail.com>>
>> > Date: Fri, Mar 3, 2017 at 5:06 PM
>> > Subject: Minimise quer

Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-07 Thread rahul challapalli
I did not get a chance to review the log file.

However the next thing I would try is to make your cluster a single node
cluster first and then run the same explain plan query separately on each
individual file.



On Mar 7, 2017 5:09 AM, "PROJJWAL SAHA" <proj.s...@gmail.com> wrote:

> Hi Rahul,
>
> thanks for your suggestions. However, I am still not able to see any
> reduction in query planning time
> by explicit column names, removing extract headers and using columns[index]
>
> As I said, I ran explain plan and its taking 30+ secs for me.
> My data is 1 GB tsv split into 20 files of 5 MB each.
> Each 5MB file has close to 50k records
> Its a 5 node cluster, and width per node is 4
> Therefore, total number of minor fragments for one major fragment is 20
> I have copied the source directory in all the drillbit nodes
>
> can you tell me a reasonable time estimate which I can expect drill to
> return result for query for the above described scenario.
> Query is - select columns[0] from 
> dfs.root.`/scratch/localdisk/drill/testdata/Cust_1G_20_tsv`
> where columns[0] ='41' and columns[3] ='568'
>
> attached is the json profile
> and the drillbit.log
>
> I also have the tracing enabled.
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler
> org.apache.drill.exec.work.foreman.Foreman
> however i see the duration of various steps in the order of ms in the logs.
> i am not sure where planning time of the order of 30 secs is consumed.
>
> Please help
>
> Regards,
> Projjwal
>
>
>
>
>
>
>
> On Mon, Mar 6, 2017 at 11:23 PM, rahul challapalli <
> challapallira...@gmail.com> wrote:
>
>> You can try the below things. For each of the below check the planning
>> time
>> individually
>>
>> 1. Run explain plan for a simple "select * from `
>> /scratch/localdisk/drill/testdata/Cust_1G_tsv`"
>> 2. Replace the '*' in your query with explicit column names
>> 3. Remove the extract header from your storage plugin configuration and
>> from your data files? Rewrite your query to use, columns[0_based_index]
>> instead of explicit column names
>>
>> Also how many columns do you have in your text files and what is the size
>> of each file? Like gautam suggested, it would be good to take a look at
>> drillbit.log file (from the foreman node where planning occurred) and the
>> query profile as well.
>>
>> - Rahul
>>
>> On Mon, Mar 6, 2017 at 9:30 AM, Gautam Parai <gpa...@mapr.com> wrote:
>>
>> > Can you please provide the drillbit.log file?
>> >
>> >
>> > Gautam
>> >
>> > 
>> > From: PROJJWAL SAHA <proj.s...@gmail.com>
>> > Sent: Monday, March 6, 2017 1:45:38 AM
>> > To: user@drill.apache.org
>> > Subject: Fwd: Minimise query plan time for dfs plugin for local file
>> > system on tsv file
>> >
>> > all, please help me in giving suggestions on what areas i can look into
>> > why the query planning time is taking so long for files which are local
>> to
>> > the drill machines. I have the same directory structure copied on all
>> the 5
>> > nodes of the cluster. I am accessing the source files using out of the
>> box
>> > dfs storage plugin.
>> >
>> > Query planning time is approx 30 secs
>> > Query execution time is apprx 1.5 secs
>> >
>> > Regards,
>> > Projjwal
>> >
>> > -- Forwarded message --
>> > From: PROJJWAL SAHA <proj.s...@gmail.com<mailto:proj.s...@gmail.com>>
>> > Date: Fri, Mar 3, 2017 at 5:06 PM
>> > Subject: Minimise query plan time for dfs plugin for local file system
>> on
>> > tsv file
>> > To: user@drill.apache.org<mailto:user@drill.apache.org>
>> >
>> >
>> > Hello all,
>> >
>> > I am quering select * from dfs.xxx where yyy (filter condition)
>> >
>> > I am using dfs storage plugin that comes out of the box from drill on a
>> > 1GB file, local to the drill cluster.
>> > The 1GB file is split into 10 files of 100 MB each.
>> > As expected I see 11 minor and 2 major fagments.
>> > The drill cluster is 5 nodes cluster with 4 cores, 32 GB  each.
>> >
>> > One observation is that the query plan time is more than 30 seconds. I
>> ran
>> > the explain plan query to validate this.
>> > The query execution time is 2 secs.
>> > total time taken is 32secs
>> >
>> > I wanted to understand how can i minimise the query plan time.
>> Suggestions
>> > ?
>> > Is the time taken described above expected ?
>> > Attached is result from explain plan query
>> >
>> > Regards,
>> > Projjwal
>> >
>> >
>> >
>>
>
>


Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-06 Thread rahul challapalli
You can try the below things. For each of the below check the planning time
individually

1. Run explain plan for a simple "select * from `
/scratch/localdisk/drill/testdata/Cust_1G_tsv`"
2. Replace the '*' in your query with explicit column names
3. Remove the extract header from your storage plugin configuration and
from your data files? Rewrite your query to use, columns[0_based_index]
instead of explicit column names

Also how many columns do you have in your text files and what is the size
of each file? Like gautam suggested, it would be good to take a look at
drillbit.log file (from the foreman node where planning occurred) and the
query profile as well.

- Rahul

On Mon, Mar 6, 2017 at 9:30 AM, Gautam Parai <gpa...@mapr.com> wrote:

> Can you please provide the drillbit.log file?
>
>
> Gautam
>
> 
> From: PROJJWAL SAHA <proj.s...@gmail.com>
> Sent: Monday, March 6, 2017 1:45:38 AM
> To: user@drill.apache.org
> Subject: Fwd: Minimise query plan time for dfs plugin for local file
> system on tsv file
>
> all, please help me in giving suggestions on what areas i can look into
> why the query planning time is taking so long for files which are local to
> the drill machines. I have the same directory structure copied on all the 5
> nodes of the cluster. I am accessing the source files using out of the box
> dfs storage plugin.
>
> Query planning time is approx 30 secs
> Query execution time is apprx 1.5 secs
>
> Regards,
> Projjwal
>
> -- Forwarded message --
> From: PROJJWAL SAHA <proj.s...@gmail.com<mailto:proj.s...@gmail.com>>
> Date: Fri, Mar 3, 2017 at 5:06 PM
> Subject: Minimise query plan time for dfs plugin for local file system on
> tsv file
> To: user@drill.apache.org<mailto:user@drill.apache.org>
>
>
> Hello all,
>
> I am quering select * from dfs.xxx where yyy (filter condition)
>
> I am using dfs storage plugin that comes out of the box from drill on a
> 1GB file, local to the drill cluster.
> The 1GB file is split into 10 files of 100 MB each.
> As expected I see 11 minor and 2 major fagments.
> The drill cluster is 5 nodes cluster with 4 cores, 32 GB  each.
>
> One observation is that the query plan time is more than 30 seconds. I ran
> the explain plan query to validate this.
> The query execution time is 2 secs.
> total time taken is 32secs
>
> I wanted to understand how can i minimise the query plan time. Suggestions
> ?
> Is the time taken described above expected ?
> Attached is result from explain plan query
>
> Regards,
> Projjwal
>
>
>


Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-06 Thread Gautam Parai
Can you please provide the drillbit.log file?


Gautam


From: PROJJWAL SAHA <proj.s...@gmail.com>
Sent: Monday, March 6, 2017 1:45:38 AM
To: user@drill.apache.org
Subject: Fwd: Minimise query plan time for dfs plugin for local file system on 
tsv file

all, please help me in giving suggestions on what areas i can look into why the 
query planning time is taking so long for files which are local to the drill 
machines. I have the same directory structure copied on all the 5 nodes of the 
cluster. I am accessing the source files using out of the box dfs storage 
plugin.

Query planning time is approx 30 secs
Query execution time is apprx 1.5 secs

Regards,
Projjwal

-- Forwarded message --
From: PROJJWAL SAHA <proj.s...@gmail.com<mailto:proj.s...@gmail.com>>
Date: Fri, Mar 3, 2017 at 5:06 PM
Subject: Minimise query plan time for dfs plugin for local file system on tsv 
file
To: user@drill.apache.org<mailto:user@drill.apache.org>


Hello all,

I am quering select * from dfs.xxx where yyy (filter condition)

I am using dfs storage plugin that comes out of the box from drill on a 1GB 
file, local to the drill cluster.
The 1GB file is split into 10 files of 100 MB each.
As expected I see 11 minor and 2 major fagments.
The drill cluster is 5 nodes cluster with 4 cores, 32 GB  each.

One observation is that the query plan time is more than 30 seconds. I ran the 
explain plan query to validate this.
The query execution time is 2 secs.
total time taken is 32secs

I wanted to understand how can i minimise the query plan time. Suggestions ?
Is the time taken described above expected ?
Attached is result from explain plan query

Regards,
Projjwal




Fwd: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-06 Thread PROJJWAL SAHA
all, please help me in giving suggestions on what areas i can look into why
the query planning time is taking so long for files which are local to the
drill machines. I have the same directory structure copied on all the 5
nodes of the cluster. I am accessing the source files using out of the box
dfs storage plugin.

Query planning time is approx 30 secs
Query execution time is apprx 1.5 secs

Regards,
Projjwal

-- Forwarded message --
From: PROJJWAL SAHA <proj.s...@gmail.com>
Date: Fri, Mar 3, 2017 at 5:06 PM
Subject: Minimise query plan time for dfs plugin for local file system on
tsv file
To: user@drill.apache.org


Hello all,

I am quering select * from dfs.xxx where yyy (filter condition)

I am using dfs storage plugin that comes out of the box from drill on a 1GB
file, local to the drill cluster.
The 1GB file is split into 10 files of 100 MB each.
As expected I see 11 minor and 2 major fagments.
The drill cluster is 5 nodes cluster with 4 cores, 32 GB  each.

One observation is that the query plan time is more than 30 seconds. I ran
the explain plan query to validate this.
The query execution time is 2 secs.
total time taken is 32secs

I wanted to understand how can i minimise the query plan time. Suggestions ?
Is the time taken described above expected ?
Attached is result from explain plan query

Regards,
Projjwal
+--+--+
| text | json |
+--+--+
| 00-00Screen
00-01  Project(*=[$0])
00-02UnionExchange
01-01  Project(T2¦¦*=[$0])
01-02SelectionVectorRemover
01-03  Filter(condition=[AND(=($1, '41'), =($2, '568'))])
01-04Project(T2¦¦*=[$0], ORDER_ID=[$1], CUSTOMER_ID=[$2])
01-05  Scan(groupscan=[EasyGroupScan 
[selectionRoot=file:/scratch/localdisk/drill/testdata/Cust_1G_tsv, numFiles=10, 
columns=[`*`], files=[file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/4.tsv, 
file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/5.tsv, 
file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/10.tsv, 
file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/2.tsv, 
file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/3.tsv, 
file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/1.tsv, 
file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/7.tsv, 
file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/6.tsv, 
file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/8.tsv, 
file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/9.tsv]]])
 | {
  "head" : {
"version" : 1,
"generator" : {
  "type" : "ExplainHandler",
  "info" : ""
},
"type" : "APACHE_DRILL_PHYSICAL",
"options" : [ ],
"queue" : 0,
"resultMode" : "EXEC"
  },
  "graph" : [ {
"pop" : "fs-scan",
"@id" : 65541,
"userName" : "optitest",
"files" : [ "file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/4.tsv", 
"file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/5.tsv", 
"file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/10.tsv", 
"file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/2.tsv", 
"file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/3.tsv", 
"file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/1.tsv", 
"file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/7.tsv", 
"file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/6.tsv", 
"file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/8.tsv", 
"file:/scratch/localdisk/drill/testdata/Cust_1G_tsv/9.tsv" ],
"storage" : {
  "type" : "file",
  "enabled" : true,
  "connection" : "file:///",
  "config" : null,
  "workspaces" : {
"root" : {
  "location" : "/",
  "writable" : true,
  "defaultInputFormat" : null
},
"tpch9m" : {
  "location" : "/user/hive/warehouse/tpch9m.db",
  "writable" : true,
  "defaultInputFormat" : null
},
"taxi1m" : {
  "location" : "/user/hive/warehouse/taxi.db/taxi_enriched_sukhdeep_1m",
  "writable" : true,
  "defaultInputFormat" : null
},
"tmp" : {
  "location" : "/tmp",
  "writable" : true,
  "defaultInputFormat" : null
}
  },
  "formats" : {
"psv" : {
  "type" : "text",
  "extensions" : [ "tbl" ],
  "delimiter" : "|"
},
"csv" : {
  "

Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-05 Thread PROJJWAL SAHA
The files are copied to the same location in all the nodes of the cluster.
And all the nodes have equal access to the files.
The files are not located to a single shared file system.

On Fri, Mar 3, 2017 at 7:12 PM, John Omernik  wrote:

> Can you help me understand what "local to the cluster" means in the context
> of a 5 node cluster? In the plan, the files are all file:// Are the files
> replicated to each node? is it a common shared filesystem?  Do all 5 nodes
> have equal access to the 10 files? I wonder if using a local FS in a
> distributed cluster is having some effect on the planning...
>
> On Fri, Mar 3, 2017 at 6:08 AM, PROJJWAL SAHA  wrote:
>
> > I did not change the default values used by drill.
> > Are you talking of changing planner.memory_limit
> > and planner.memory.max_query_memory_per_node ?
> > If there are any other debug work that I can do, pls suggest
> >
> > Regards
> >
> > On Fri, Mar 3, 2017 at 5:14 PM, Nitin Pawar 
> > wrote:
> >
> > > how much memory have you set for planner ?
> > >
> > > On Fri, Mar 3, 2017 at 5:06 PM, PROJJWAL SAHA 
> > wrote:
> > >
> > > > Hello all,
> > > >
> > > > I am quering select * from dfs.xxx where yyy (filter condition)
> > > >
> > > > I am using dfs storage plugin that comes out of the box from drill
> on a
> > > > 1GB file, local to the drill cluster.
> > > > The 1GB file is split into 10 files of 100 MB each.
> > > > As expected I see 11 minor and 2 major fagments.
> > > > The drill cluster is 5 nodes cluster with 4 cores, 32 GB  each.
> > > >
> > > > One observation is that the query plan time is more than 30 seconds.
> I
> > > ran
> > > > the explain plan query to validate this.
> > > > The query execution time is 2 secs.
> > > > total time taken is 32secs
> > > >
> > > > I wanted to understand how can i minimise the query plan time.
> > > Suggestions
> > > > ?
> > > > Is the time taken described above expected ?
> > > > Attached is result from explain plan query
> > > >
> > > > Regards,
> > > > Projjwal
> > > >
> > > >
> > >
> > >
> > > --
> > > Nitin Pawar
> > >
> >
>


Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-03 Thread John Omernik
Can you help me understand what "local to the cluster" means in the context
of a 5 node cluster? In the plan, the files are all file:// Are the files
replicated to each node? is it a common shared filesystem?  Do all 5 nodes
have equal access to the 10 files? I wonder if using a local FS in a
distributed cluster is having some effect on the planning...

On Fri, Mar 3, 2017 at 6:08 AM, PROJJWAL SAHA  wrote:

> I did not change the default values used by drill.
> Are you talking of changing planner.memory_limit
> and planner.memory.max_query_memory_per_node ?
> If there are any other debug work that I can do, pls suggest
>
> Regards
>
> On Fri, Mar 3, 2017 at 5:14 PM, Nitin Pawar 
> wrote:
>
> > how much memory have you set for planner ?
> >
> > On Fri, Mar 3, 2017 at 5:06 PM, PROJJWAL SAHA 
> wrote:
> >
> > > Hello all,
> > >
> > > I am quering select * from dfs.xxx where yyy (filter condition)
> > >
> > > I am using dfs storage plugin that comes out of the box from drill on a
> > > 1GB file, local to the drill cluster.
> > > The 1GB file is split into 10 files of 100 MB each.
> > > As expected I see 11 minor and 2 major fagments.
> > > The drill cluster is 5 nodes cluster with 4 cores, 32 GB  each.
> > >
> > > One observation is that the query plan time is more than 30 seconds. I
> > ran
> > > the explain plan query to validate this.
> > > The query execution time is 2 secs.
> > > total time taken is 32secs
> > >
> > > I wanted to understand how can i minimise the query plan time.
> > Suggestions
> > > ?
> > > Is the time taken described above expected ?
> > > Attached is result from explain plan query
> > >
> > > Regards,
> > > Projjwal
> > >
> > >
> >
> >
> > --
> > Nitin Pawar
> >
>


Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-03 Thread PROJJWAL SAHA
I did not change the default values used by drill.
Are you talking of changing planner.memory_limit
and planner.memory.max_query_memory_per_node ?
If there are any other debug work that I can do, pls suggest

Regards

On Fri, Mar 3, 2017 at 5:14 PM, Nitin Pawar  wrote:

> how much memory have you set for planner ?
>
> On Fri, Mar 3, 2017 at 5:06 PM, PROJJWAL SAHA  wrote:
>
> > Hello all,
> >
> > I am quering select * from dfs.xxx where yyy (filter condition)
> >
> > I am using dfs storage plugin that comes out of the box from drill on a
> > 1GB file, local to the drill cluster.
> > The 1GB file is split into 10 files of 100 MB each.
> > As expected I see 11 minor and 2 major fagments.
> > The drill cluster is 5 nodes cluster with 4 cores, 32 GB  each.
> >
> > One observation is that the query plan time is more than 30 seconds. I
> ran
> > the explain plan query to validate this.
> > The query execution time is 2 secs.
> > total time taken is 32secs
> >
> > I wanted to understand how can i minimise the query plan time.
> Suggestions
> > ?
> > Is the time taken described above expected ?
> > Attached is result from explain plan query
> >
> > Regards,
> > Projjwal
> >
> >
>
>
> --
> Nitin Pawar
>


Re: Minimise query plan time for dfs plugin for local file system on tsv file

2017-03-03 Thread Nitin Pawar
how much memory have you set for planner ?

On Fri, Mar 3, 2017 at 5:06 PM, PROJJWAL SAHA  wrote:

> Hello all,
>
> I am quering select * from dfs.xxx where yyy (filter condition)
>
> I am using dfs storage plugin that comes out of the box from drill on a
> 1GB file, local to the drill cluster.
> The 1GB file is split into 10 files of 100 MB each.
> As expected I see 11 minor and 2 major fagments.
> The drill cluster is 5 nodes cluster with 4 cores, 32 GB  each.
>
> One observation is that the query plan time is more than 30 seconds. I ran
> the explain plan query to validate this.
> The query execution time is 2 secs.
> total time taken is 32secs
>
> I wanted to understand how can i minimise the query plan time. Suggestions
> ?
> Is the time taken described above expected ?
> Attached is result from explain plan query
>
> Regards,
> Projjwal
>
>


-- 
Nitin Pawar