[jira] [Updated] (DRILL-3944) Drill MAXDIR Unknown variable or type "FILE_SEPARATOR"

2015-10-16 Thread Jitendra (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-3944?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jitendra updated DRILL-3944:

Summary: Drill MAXDIR Unknown variable or type "FILE_SEPARATOR"  (was: 
Drill  Unknown variable or type "FILE_SEPARATOR")

> Drill MAXDIR Unknown variable or type "FILE_SEPARATOR"
> --
>
> Key: DRILL-3944
> URL: https://issues.apache.org/jira/browse/DRILL-3944
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.2.0
> Environment: 1.2.0
>Reporter: Jitendra
>
> We are facing issue with MAXDIR function, below is the query we are using to 
> reproduce this issue.
> 0: jdbc:drill:drillbit=localhost> select maxdir('vspace.wspace', 'freemat2') 
> from vspace.wspace.`freemat2`;
> Error: SYSTEM ERROR: CompileException: Line 75, Column 70: Unknown variable 
> or type "FILE_SEPARATOR"
> Fragment 0:0
> [Error Id: d17c6e48-554d-4934-bc4d-783ca3dc6f51 on 10.10.99.71:31010] 
> (state=,code=0);
> Below are the drillbit logs.
> 2015-10-09 21:26:21,972 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.fragment.FragmentExecutor - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State change requested 
> AWAITING_ALLOCATION --> RUNNING
> 2015-10-09 21:26:21,972 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.f.FragmentStatusReporter - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State to report: RUNNING
> 2015-10-09 21:26:22,038 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.fragment.FragmentExecutor - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State change requested RUNNING --> 
> FINISHED
> 2015-10-09 21:26:22,039 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.f.FragmentStatusReporter - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State to report: FINISHED
> 2015-10-09 21:29:59,281 [29e7ce27-9cad-9d8a-a482-39f54cc7deda:foreman] INFO 
> o.a.d.e.store.mock.MockStorageEngine - Failure while attempting to check for 
> Parquet metadata file.
> java.io.IOException: Open failed for file: /vspace/wspace/freemat2/20151005, 
> error: Invalid argument (22)
> at com.mapr.fs.MapRClientImpl.open(MapRClientImpl.java:212) 
> ~[maprfs-4.1.0-mapr.jar:4.1.0-mapr]
> at com.mapr.fs.MapRFileSystem.open(MapRFileSystem.java:862) 
> ~[maprfs-4.1.0-mapr.jar:4.1.0-mapr]
> at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:800) 
> ~[hadoop-common-2.5.1-mapr-1503.jar:na]
> at 
> org.apache.drill.exec.store.dfs.DrillFileSystem.open(DrillFileSystem.java:132)
>  ~[drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.BasicFormatMatcher$MagicStringMatcher.matches(BasicFormatMatcher.java:142)
>  ~[drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.BasicFormatMatcher.isFileReadable(BasicFormatMatcher.java:112)
>  ~[drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.parquet.ParquetFormatPlugin$ParquetFormatMatcher.isDirReadable(ParquetFormatPlugin.java:256)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.parquet.ParquetFormatPlugin$ParquetFormatMatcher.isReadable(ParquetFormatPlugin.java:210)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create(WorkspaceSchemaFactory.java:326)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create(WorkspaceSchemaFactory.java:153)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.planner.sql.ExpandingConcurrentMap.getNewEntry(ExpandingConcurrentMap.java:96)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.planner.sql.ExpandingConcurrentMap.get(ExpandingConcurrentMap.java:90)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.getTable(WorkspaceSchemaFactory.java:276)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.calcite.jdbc.SimpleCalciteSchema.getTable(SimpleCalciteSchema.java:83)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> org.apache.calcite.prepare.CalciteCatalogReader.getTableFrom(CalciteCatalogReader.java:116)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> org.apache.calcite.prepare.CalciteCatalogReader.getTable(CalciteCatalogReader.java:99)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> org.apache.calcite.prepare.CalciteCatalogReader.getTable(CalciteCatalogReader.java:70)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> org.apache.calcite.sql.validate.EmptyScope.getTableNamespace(EmptyScope.java:75)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> org.apache.calcite.sql.validate.DelegatingScope.getTableNamespace(DelegatingScope.java:124)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> 

[jira] [Created] (DRILL-3944) Drill Unknown variable or type "FILE_SEPARATOR"

2015-10-16 Thread Jitendra (JIRA)
Jitendra created DRILL-3944:
---

 Summary: Drill  Unknown variable or type "FILE_SEPARATOR"
 Key: DRILL-3944
 URL: https://issues.apache.org/jira/browse/DRILL-3944
 Project: Apache Drill
  Issue Type: Bug
Affects Versions: 1.2.0
 Environment: 1.2.0
Reporter: Jitendra


We are facing issue with MAXDIR function, below is the query we are using to 
reproduce this issue.

0: jdbc:drill:drillbit=localhost> select maxdir('vspace.wspace', 'freemat2') 
from vspace.wspace.`freemat2`;
Error: SYSTEM ERROR: CompileException: Line 75, Column 70: Unknown variable or 
type "FILE_SEPARATOR"
Fragment 0:0
[Error Id: d17c6e48-554d-4934-bc4d-783ca3dc6f51 on 10.10.99.71:31010] 
(state=,code=0);



Below are the drillbit logs.


2015-10-09 21:26:21,972 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
o.a.d.e.w.fragment.FragmentExecutor - 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: 
State change requested AWAITING_ALLOCATION --> RUNNING
2015-10-09 21:26:21,972 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
o.a.d.e.w.f.FragmentStatusReporter - 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: 
State to report: RUNNING
2015-10-09 21:26:22,038 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
o.a.d.e.w.fragment.FragmentExecutor - 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: 
State change requested RUNNING --> FINISHED
2015-10-09 21:26:22,039 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
o.a.d.e.w.f.FragmentStatusReporter - 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: 
State to report: FINISHED
2015-10-09 21:29:59,281 [29e7ce27-9cad-9d8a-a482-39f54cc7deda:foreman] INFO 
o.a.d.e.store.mock.MockStorageEngine - Failure while attempting to check for 
Parquet metadata file.
java.io.IOException: Open failed for file: /vspace/wspace/freemat2/20151005, 
error: Invalid argument (22)
at com.mapr.fs.MapRClientImpl.open(MapRClientImpl.java:212) 
~[maprfs-4.1.0-mapr.jar:4.1.0-mapr]
at com.mapr.fs.MapRFileSystem.open(MapRFileSystem.java:862) 
~[maprfs-4.1.0-mapr.jar:4.1.0-mapr]
at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:800) 
~[hadoop-common-2.5.1-mapr-1503.jar:na]
at 
org.apache.drill.exec.store.dfs.DrillFileSystem.open(DrillFileSystem.java:132) 
~[drill-java-exec-1.2.0.jar:1.2.0]
at 
org.apache.drill.exec.store.dfs.BasicFormatMatcher$MagicStringMatcher.matches(BasicFormatMatcher.java:142)
 ~[drill-java-exec-1.2.0.jar:1.2.0]
at 
org.apache.drill.exec.store.dfs.BasicFormatMatcher.isFileReadable(BasicFormatMatcher.java:112)
 ~[drill-java-exec-1.2.0.jar:1.2.0]
at 
org.apache.drill.exec.store.parquet.ParquetFormatPlugin$ParquetFormatMatcher.isDirReadable(ParquetFormatPlugin.java:256)
 [drill-java-exec-1.2.0.jar:1.2.0]
at 
org.apache.drill.exec.store.parquet.ParquetFormatPlugin$ParquetFormatMatcher.isReadable(ParquetFormatPlugin.java:210)
 [drill-java-exec-1.2.0.jar:1.2.0]
at 
org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create(WorkspaceSchemaFactory.java:326)
 [drill-java-exec-1.2.0.jar:1.2.0]
at 
org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create(WorkspaceSchemaFactory.java:153)
 [drill-java-exec-1.2.0.jar:1.2.0]
at 
org.apache.drill.exec.planner.sql.ExpandingConcurrentMap.getNewEntry(ExpandingConcurrentMap.java:96)
 [drill-java-exec-1.2.0.jar:1.2.0]
at 
org.apache.drill.exec.planner.sql.ExpandingConcurrentMap.get(ExpandingConcurrentMap.java:90)
 [drill-java-exec-1.2.0.jar:1.2.0]
at 
org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.getTable(WorkspaceSchemaFactory.java:276)
 [drill-java-exec-1.2.0.jar:1.2.0]
at 
org.apache.calcite.jdbc.SimpleCalciteSchema.getTable(SimpleCalciteSchema.java:83)
 [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
at 
org.apache.calcite.prepare.CalciteCatalogReader.getTableFrom(CalciteCatalogReader.java:116)
 [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
at 
org.apache.calcite.prepare.CalciteCatalogReader.getTable(CalciteCatalogReader.java:99)
 [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
at 
org.apache.calcite.prepare.CalciteCatalogReader.getTable(CalciteCatalogReader.java:70)
 [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
at 
org.apache.calcite.sql.validate.EmptyScope.getTableNamespace(EmptyScope.java:75)
 [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
at 
org.apache.calcite.sql.validate.DelegatingScope.getTableNamespace(DelegatingScope.java:124)
 [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
at 
org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:104)
 [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
at 
org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:86)
 [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:877)
 [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
at 

[jira] [Resolved] (DRILL-3943) CannotPlanException caused by ExpressionReductionRule

2015-10-16 Thread Jason Altekruse (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-3943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Altekruse resolved DRILL-3943.

Resolution: Fixed

Fixed in 826144d89391dbadfc7fec84e633359c602bcd5a

> CannotPlanException caused by ExpressionReductionRule
> -
>
> Key: DRILL-3943
> URL: https://issues.apache.org/jira/browse/DRILL-3943
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Reporter: Sean Hsuan-Yi Chu
>Assignee: Jason Altekruse
> Fix For: 1.3.0
>
>
> For a query such as:
> {code}
> SELECT count(DISTINCT employee_id) as col1,
> count((to_number(date_diff(now(), cast(birth_date AS date)),''))) as col2
> FROM cp.`employee.json`
> {code}
> cannot plan exception will be thrown because ExpressionReductionRule does not 
> properly simply the call "now()".
> This issue is similar to DRILL-2808, but that one focuses on error message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-3944) Drill MAXDIR Unknown variable or type "FILE_SEPARATOR"

2015-10-16 Thread Jason Altekruse (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14961294#comment-14961294
 ] 

Jason Altekruse commented on DRILL-3944:


The maxdir function is not designed to be used in the select list. Without a 
filter on the directory name Drill will read all of the data in all sub 
directories and evaluate a function for each row it finds (maxdir is a 
heavyweight function that asks the filesystem to enumerate all of the files, 
which means even if this did run it would take a really long time). Maxdir is 
provided as a way to run a simple 'query' against the directory structure to 
limit how much is read. Try to use this query instead:

select dir0 from vspace.wspace.`freemat2` where dir0 = maxdir('vspace.wspace', 
'freemat2');

If you just want to query the directory structure this might not be exactly 
what you want, because you will get a resulting row for each row found in the 
combination of all files found in the max dir. Queries like this would be 
better suited for the file structure exposed as a table itself, with one row 
for each directory down the tree. Drill does not currently provide this, but we 
could open a new JIRA to discuss a possible design.

I will try to take a look at this to fix the bad error message soon, so you can 
keep the JIRA open even if this allows the query to run and fit your needs.

> Drill MAXDIR Unknown variable or type "FILE_SEPARATOR"
> --
>
> Key: DRILL-3944
> URL: https://issues.apache.org/jira/browse/DRILL-3944
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.2.0
> Environment: 1.2.0
>Reporter: Jitendra
>
> We are facing issue with MAXDIR function, below is the query we are using to 
> reproduce this issue.
> 0: jdbc:drill:drillbit=localhost> select maxdir('vspace.wspace', 'freemat2') 
> from vspace.wspace.`freemat2`;
> Error: SYSTEM ERROR: CompileException: Line 75, Column 70: Unknown variable 
> or type "FILE_SEPARATOR"
> Fragment 0:0
> [Error Id: d17c6e48-554d-4934-bc4d-783ca3dc6f51 on 10.10.99.71:31010] 
> (state=,code=0);
> Below are the drillbit logs.
> 2015-10-09 21:26:21,972 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.fragment.FragmentExecutor - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State change requested 
> AWAITING_ALLOCATION --> RUNNING
> 2015-10-09 21:26:21,972 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.f.FragmentStatusReporter - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State to report: RUNNING
> 2015-10-09 21:26:22,038 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.fragment.FragmentExecutor - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State change requested RUNNING --> 
> FINISHED
> 2015-10-09 21:26:22,039 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.f.FragmentStatusReporter - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State to report: FINISHED
> 2015-10-09 21:29:59,281 [29e7ce27-9cad-9d8a-a482-39f54cc7deda:foreman] INFO 
> o.a.d.e.store.mock.MockStorageEngine - Failure while attempting to check for 
> Parquet metadata file.
> java.io.IOException: Open failed for file: /vspace/wspace/freemat2/20151005, 
> error: Invalid argument (22)
> at com.mapr.fs.MapRClientImpl.open(MapRClientImpl.java:212) 
> ~[maprfs-4.1.0-mapr.jar:4.1.0-mapr]
> at com.mapr.fs.MapRFileSystem.open(MapRFileSystem.java:862) 
> ~[maprfs-4.1.0-mapr.jar:4.1.0-mapr]
> at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:800) 
> ~[hadoop-common-2.5.1-mapr-1503.jar:na]
> at 
> org.apache.drill.exec.store.dfs.DrillFileSystem.open(DrillFileSystem.java:132)
>  ~[drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.BasicFormatMatcher$MagicStringMatcher.matches(BasicFormatMatcher.java:142)
>  ~[drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.BasicFormatMatcher.isFileReadable(BasicFormatMatcher.java:112)
>  ~[drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.parquet.ParquetFormatPlugin$ParquetFormatMatcher.isDirReadable(ParquetFormatPlugin.java:256)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.parquet.ParquetFormatPlugin$ParquetFormatMatcher.isReadable(ParquetFormatPlugin.java:210)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create(WorkspaceSchemaFactory.java:326)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create(WorkspaceSchemaFactory.java:153)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.planner.sql.ExpandingConcurrentMap.getNewEntry(ExpandingConcurrentMap.java:96)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> 

[jira] [Assigned] (DRILL-3944) Drill MAXDIR Unknown variable or type "FILE_SEPARATOR"

2015-10-16 Thread Jason Altekruse (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-3944?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Altekruse reassigned DRILL-3944:
--

Assignee: Jason Altekruse

> Drill MAXDIR Unknown variable or type "FILE_SEPARATOR"
> --
>
> Key: DRILL-3944
> URL: https://issues.apache.org/jira/browse/DRILL-3944
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.2.0
> Environment: 1.2.0
>Reporter: Jitendra
>Assignee: Jason Altekruse
>
> We are facing issue with MAXDIR function, below is the query we are using to 
> reproduce this issue.
> 0: jdbc:drill:drillbit=localhost> select maxdir('vspace.wspace', 'freemat2') 
> from vspace.wspace.`freemat2`;
> Error: SYSTEM ERROR: CompileException: Line 75, Column 70: Unknown variable 
> or type "FILE_SEPARATOR"
> Fragment 0:0
> [Error Id: d17c6e48-554d-4934-bc4d-783ca3dc6f51 on 10.10.99.71:31010] 
> (state=,code=0);
> Below are the drillbit logs.
> 2015-10-09 21:26:21,972 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.fragment.FragmentExecutor - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State change requested 
> AWAITING_ALLOCATION --> RUNNING
> 2015-10-09 21:26:21,972 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.f.FragmentStatusReporter - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State to report: RUNNING
> 2015-10-09 21:26:22,038 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.fragment.FragmentExecutor - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State change requested RUNNING --> 
> FINISHED
> 2015-10-09 21:26:22,039 [29e7cf02-02bf-b007-72f2-52c67c80ea1c:frag:0:0] INFO 
> o.a.d.e.w.f.FragmentStatusReporter - 
> 29e7cf02-02bf-b007-72f2-52c67c80ea1c:0:0: State to report: FINISHED
> 2015-10-09 21:29:59,281 [29e7ce27-9cad-9d8a-a482-39f54cc7deda:foreman] INFO 
> o.a.d.e.store.mock.MockStorageEngine - Failure while attempting to check for 
> Parquet metadata file.
> java.io.IOException: Open failed for file: /vspace/wspace/freemat2/20151005, 
> error: Invalid argument (22)
> at com.mapr.fs.MapRClientImpl.open(MapRClientImpl.java:212) 
> ~[maprfs-4.1.0-mapr.jar:4.1.0-mapr]
> at com.mapr.fs.MapRFileSystem.open(MapRFileSystem.java:862) 
> ~[maprfs-4.1.0-mapr.jar:4.1.0-mapr]
> at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:800) 
> ~[hadoop-common-2.5.1-mapr-1503.jar:na]
> at 
> org.apache.drill.exec.store.dfs.DrillFileSystem.open(DrillFileSystem.java:132)
>  ~[drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.BasicFormatMatcher$MagicStringMatcher.matches(BasicFormatMatcher.java:142)
>  ~[drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.BasicFormatMatcher.isFileReadable(BasicFormatMatcher.java:112)
>  ~[drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.parquet.ParquetFormatPlugin$ParquetFormatMatcher.isDirReadable(ParquetFormatPlugin.java:256)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.parquet.ParquetFormatPlugin$ParquetFormatMatcher.isReadable(ParquetFormatPlugin.java:210)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create(WorkspaceSchemaFactory.java:326)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.create(WorkspaceSchemaFactory.java:153)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.planner.sql.ExpandingConcurrentMap.getNewEntry(ExpandingConcurrentMap.java:96)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.planner.sql.ExpandingConcurrentMap.get(ExpandingConcurrentMap.java:90)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory$WorkspaceSchema.getTable(WorkspaceSchemaFactory.java:276)
>  [drill-java-exec-1.2.0.jar:1.2.0]
> at 
> org.apache.calcite.jdbc.SimpleCalciteSchema.getTable(SimpleCalciteSchema.java:83)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> org.apache.calcite.prepare.CalciteCatalogReader.getTableFrom(CalciteCatalogReader.java:116)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> org.apache.calcite.prepare.CalciteCatalogReader.getTable(CalciteCatalogReader.java:99)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> org.apache.calcite.prepare.CalciteCatalogReader.getTable(CalciteCatalogReader.java:70)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> org.apache.calcite.sql.validate.EmptyScope.getTableNamespace(EmptyScope.java:75)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> org.apache.calcite.sql.validate.DelegatingScope.getTableNamespace(DelegatingScope.java:124)
>  [calcite-core-1.4.0-drill-r5.jar:1.4.0-drill-r5]
> at 
> 

[jira] [Commented] (DRILL-3943) CannotPlanException caused by ExpressionReductionRule

2015-10-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14961421#comment-14961421
 ] 

ASF GitHub Bot commented on DRILL-3943:
---

Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/206


> CannotPlanException caused by ExpressionReductionRule
> -
>
> Key: DRILL-3943
> URL: https://issues.apache.org/jira/browse/DRILL-3943
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Reporter: Sean Hsuan-Yi Chu
>Assignee: Jason Altekruse
> Fix For: 1.3.0
>
>
> For a query such as:
> {code}
> SELECT count(DISTINCT employee_id) as col1,
> count((to_number(date_diff(now(), cast(birth_date AS date)),''))) as col2
> FROM cp.`employee.json`
> {code}
> cannot plan exception will be thrown because ExpressionReductionRule does not 
> properly simply the call "now()".
> This issue is similar to DRILL-2808, but that one focuses on error message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-2808) Substr function throws weird message when wrong arguments are passed in

2015-10-16 Thread Sean Hsuan-Yi Chu (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-2808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14960297#comment-14960297
 ] 

Sean Hsuan-Yi Chu commented on DRILL-2808:
--

This one focuses on Error message in general.

DRILL-3943 focuses on a special case which leads to cannot plan exception.

> Substr function throws weird message when wrong arguments are passed in
> ---
>
> Key: DRILL-2808
> URL: https://issues.apache.org/jira/browse/DRILL-2808
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Affects Versions: 0.9.0
>Reporter: Victoria Markman
>Assignee: Sean Hsuan-Yi Chu
> Fix For: 1.3.0
>
>
> #Wed Apr 15 17:37:25 EDT 2015
> git.commit.id.abbrev=cb47df0
> {code}
> 0: jdbc:drill:schema=dfs> select substr(0, 1, 'abc') from sys.options limit 1;
> Query failed: SYSTEM ERROR: Unexpected exception during fragment 
> initialization: Internal error: Error while applying rule 
> ReduceExpressionsRule[Project], args 
> [rel#53990:ProjectRel.NONE.ANY([]).[](child=rel#53989:Subset#0.ENUMERABLE.ANY([]).[],EXPR$0=SUBSTR(0,
>  1, 'abc'))]
> [1f7e0c35-fc65-4a2f-b668-12e9baf5c9b8 on atsqa4-133.qa.lab:31010]
> Error: exception while executing query: Failure while executing query. 
> (state=,code=0)
> {code}
> drillbit.log
> {code}
> 2015-04-16 22:04:32,029 [2acfce0f-8af4-9786-4799-9180b9bac219:foreman] INFO  
> o.a.drill.exec.work.foreman.Foreman - State change requested.  PENDING --> 
> FAILED
> org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception 
> during fragment initialization: Internal error: Error while applying rule 
> ReduceExpressionsRule[Project], args 
> [rel#54047:ProjectRel.NONE.ANY([]).[](child=rel#54046:Subset#0.ENUMERABLE.ANY([]).[],EXPR$0=SUBSTR(0,
>  1, 'abc'))]
> at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:211) 
> [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>  [na:1.7.0_71]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>  [na:1.7.0_71]
> at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
> Caused by: java.lang.AssertionError: Internal error: Error while applying 
> rule ReduceExpressionsRule[Project], args 
> [rel#54047:ProjectRel.NONE.ANY([]).[](child=rel#54046:Subset#0.ENUMERABLE.ANY([]).[],EXPR$0=SUBSTR(0,
>  1, 'abc'))]
> at org.eigenbase.util.Util.newInternal(Util.java:750) 
> ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> org.eigenbase.relopt.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:246)
>  ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> org.eigenbase.relopt.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:661)
>  ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> net.hydromatic.optiq.tools.Programs$RuleSetProgram.run(Programs.java:165) 
> ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> net.hydromatic.optiq.prepare.PlannerImpl.transform(PlannerImpl.java:278) 
> ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel(DefaultSqlHandler.java:196)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:137)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:155)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:770) 
> [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:202) 
> [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> ... 3 common frames omitted
> Caused by: java.lang.RuntimeException: Error in evaluating function of 
> castBIGINT
> at 
> org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator$EvalVisitor.visitFunctionHolderExpression(InterpreterEvaluator.java:323)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator$EvalVisitor.visitFunctionHolderExpression(InterpreterEvaluator.java:147)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.common.expression.FunctionHolderExpression.accept(FunctionHolderExpression.java:47)
>  ~[drill-common-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> 

[jira] [Updated] (DRILL-3943) CannotPlanException caused by ExpressionReductionRule

2015-10-16 Thread Sean Hsuan-Yi Chu (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-3943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sean Hsuan-Yi Chu updated DRILL-3943:
-
Assignee: Jason Altekruse  (was: Sean Hsuan-Yi Chu)

> CannotPlanException caused by ExpressionReductionRule
> -
>
> Key: DRILL-3943
> URL: https://issues.apache.org/jira/browse/DRILL-3943
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Reporter: Sean Hsuan-Yi Chu
>Assignee: Jason Altekruse
> Fix For: 1.3.0
>
>
> For a query such as:
> {code}
> SELECT count(DISTINCT employee_id) as col1,
> count((to_number(date_diff(now(), cast(birth_date AS date)),''))) as col2
> FROM cp.`employee.json`
> {code}
> cannot plan exception will be thrown because ExpressionReductionRule does not 
> properly simply the call "now()".
> This issue is similar to DRILL-2808, but that one focuses on error message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-3943) CannotPlanException caused by ExpressionReductionRule

2015-10-16 Thread Sean Hsuan-Yi Chu (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14960303#comment-14960303
 ] 

Sean Hsuan-Yi Chu commented on DRILL-3943:
--

[~jaltekruse] Can you help review? Thanks!

> CannotPlanException caused by ExpressionReductionRule
> -
>
> Key: DRILL-3943
> URL: https://issues.apache.org/jira/browse/DRILL-3943
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Reporter: Sean Hsuan-Yi Chu
>Assignee: Jason Altekruse
> Fix For: 1.3.0
>
>
> For a query such as:
> {code}
> SELECT count(DISTINCT employee_id) as col1,
> count((to_number(date_diff(now(), cast(birth_date AS date)),''))) as col2
> FROM cp.`employee.json`
> {code}
> cannot plan exception will be thrown because ExpressionReductionRule does not 
> properly simply the call "now()".
> This issue is similar to DRILL-2808, but that one focuses on error message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-3943) CannotPlanException caused by ExpressionReductionRule

2015-10-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14960300#comment-14960300
 ] 

ASF GitHub Bot commented on DRILL-3943:
---

GitHub user hsuanyi opened a pull request:

https://github.com/apache/drill/pull/206

DRILL-3943: In constant folding, when the the data type of the return…

… value is TimeStamp, generate TimeStamp Literal

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/hsuanyi/incubator-drill DRILL-3943

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/206.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #206


commit 74267c226cd447c98b36df8ef44f4121ef581c90
Author: Hsuan-Yi Chu 
Date:   2015-10-15T03:55:34Z

DRILL-3943: In constant folding, when the the data type of the return value 
is TimeStamp, generate TimeStamp Literal




> CannotPlanException caused by ExpressionReductionRule
> -
>
> Key: DRILL-3943
> URL: https://issues.apache.org/jira/browse/DRILL-3943
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Reporter: Sean Hsuan-Yi Chu
>Assignee: Sean Hsuan-Yi Chu
> Fix For: 1.3.0
>
>
> For a query such as:
> {code}
> SELECT count(DISTINCT employee_id) as col1,
> count((to_number(date_diff(now(), cast(birth_date AS date)),''))) as col2
> FROM cp.`employee.json`
> {code}
> cannot plan exception will be thrown because ExpressionReductionRule does not 
> properly simply the call "now()".
> This issue is similar to DRILL-2808, but that one focuses on error message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (DRILL-3943) CannotPlanException caused by ExpressionReductionRule

2015-10-16 Thread Sean Hsuan-Yi Chu (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-3943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sean Hsuan-Yi Chu updated DRILL-3943:
-
Summary: CannotPlanException caused by ExpressionReductionRule  (was: 
CannotPlanException caused by ExpressionReduction rule)

> CannotPlanException caused by ExpressionReductionRule
> -
>
> Key: DRILL-3943
> URL: https://issues.apache.org/jira/browse/DRILL-3943
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Reporter: Sean Hsuan-Yi Chu
>Assignee: Sean Hsuan-Yi Chu
> Fix For: 1.3.0
>
>
> For a query such as:
> {code}
> SELECT count(DISTINCT employee_id) as col1,
> count((to_number(date_diff(now(), cast(birth_date AS date)),''))) as col2
> FROM cp.`employee.json`
> {code}
> cannot plan exception will be thrown because ExpressionReductionRule does not 
> properly simply the call "now()".
> This issue is similar to DRILL-2808, but that one focuses on error message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-2808) Substr function throws weird message when wrong arguments are passed in

2015-10-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-2808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14960288#comment-14960288
 ] 

ASF GitHub Bot commented on DRILL-2808:
---

Github user hsuanyi closed the pull request at:

https://github.com/apache/drill/pull/204


> Substr function throws weird message when wrong arguments are passed in
> ---
>
> Key: DRILL-2808
> URL: https://issues.apache.org/jira/browse/DRILL-2808
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Affects Versions: 0.9.0
>Reporter: Victoria Markman
>Assignee: Sean Hsuan-Yi Chu
> Fix For: 1.3.0
>
>
> #Wed Apr 15 17:37:25 EDT 2015
> git.commit.id.abbrev=cb47df0
> {code}
> 0: jdbc:drill:schema=dfs> select substr(0, 1, 'abc') from sys.options limit 1;
> Query failed: SYSTEM ERROR: Unexpected exception during fragment 
> initialization: Internal error: Error while applying rule 
> ReduceExpressionsRule[Project], args 
> [rel#53990:ProjectRel.NONE.ANY([]).[](child=rel#53989:Subset#0.ENUMERABLE.ANY([]).[],EXPR$0=SUBSTR(0,
>  1, 'abc'))]
> [1f7e0c35-fc65-4a2f-b668-12e9baf5c9b8 on atsqa4-133.qa.lab:31010]
> Error: exception while executing query: Failure while executing query. 
> (state=,code=0)
> {code}
> drillbit.log
> {code}
> 2015-04-16 22:04:32,029 [2acfce0f-8af4-9786-4799-9180b9bac219:foreman] INFO  
> o.a.drill.exec.work.foreman.Foreman - State change requested.  PENDING --> 
> FAILED
> org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception 
> during fragment initialization: Internal error: Error while applying rule 
> ReduceExpressionsRule[Project], args 
> [rel#54047:ProjectRel.NONE.ANY([]).[](child=rel#54046:Subset#0.ENUMERABLE.ANY([]).[],EXPR$0=SUBSTR(0,
>  1, 'abc'))]
> at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:211) 
> [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>  [na:1.7.0_71]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>  [na:1.7.0_71]
> at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
> Caused by: java.lang.AssertionError: Internal error: Error while applying 
> rule ReduceExpressionsRule[Project], args 
> [rel#54047:ProjectRel.NONE.ANY([]).[](child=rel#54046:Subset#0.ENUMERABLE.ANY([]).[],EXPR$0=SUBSTR(0,
>  1, 'abc'))]
> at org.eigenbase.util.Util.newInternal(Util.java:750) 
> ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> org.eigenbase.relopt.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:246)
>  ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> org.eigenbase.relopt.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:661)
>  ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> net.hydromatic.optiq.tools.Programs$RuleSetProgram.run(Programs.java:165) 
> ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> net.hydromatic.optiq.prepare.PlannerImpl.transform(PlannerImpl.java:278) 
> ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel(DefaultSqlHandler.java:196)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:137)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:155)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:770) 
> [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:202) 
> [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> ... 3 common frames omitted
> Caused by: java.lang.RuntimeException: Error in evaluating function of 
> castBIGINT
> at 
> org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator$EvalVisitor.visitFunctionHolderExpression(InterpreterEvaluator.java:323)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator$EvalVisitor.visitFunctionHolderExpression(InterpreterEvaluator.java:147)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.common.expression.FunctionHolderExpression.accept(FunctionHolderExpression.java:47)
>  ~[drill-common-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator$EvalVisitor.visitFunctionHolderExpression(InterpreterEvaluator.java:251)
>  

[jira] [Commented] (DRILL-2808) Substr function throws weird message when wrong arguments are passed in

2015-10-16 Thread Sean Hsuan-Yi Chu (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-2808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14960270#comment-14960270
 ] 

Sean Hsuan-Yi Chu commented on DRILL-2808:
--

In this special case,
{code}
SELECT count(DISTINCT employee_id) as col1,
count((to_number(date_diff(now(), cast(birth_date AS date)),''))) as col2
FROM cp.`employee.json`
{code}
it would cause CannotPlanException.

This is a particularly important case. 

> Substr function throws weird message when wrong arguments are passed in
> ---
>
> Key: DRILL-2808
> URL: https://issues.apache.org/jira/browse/DRILL-2808
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Affects Versions: 0.9.0
>Reporter: Victoria Markman
>Assignee: Sean Hsuan-Yi Chu
> Fix For: 1.3.0
>
>
> #Wed Apr 15 17:37:25 EDT 2015
> git.commit.id.abbrev=cb47df0
> {code}
> 0: jdbc:drill:schema=dfs> select substr(0, 1, 'abc') from sys.options limit 1;
> Query failed: SYSTEM ERROR: Unexpected exception during fragment 
> initialization: Internal error: Error while applying rule 
> ReduceExpressionsRule[Project], args 
> [rel#53990:ProjectRel.NONE.ANY([]).[](child=rel#53989:Subset#0.ENUMERABLE.ANY([]).[],EXPR$0=SUBSTR(0,
>  1, 'abc'))]
> [1f7e0c35-fc65-4a2f-b668-12e9baf5c9b8 on atsqa4-133.qa.lab:31010]
> Error: exception while executing query: Failure while executing query. 
> (state=,code=0)
> {code}
> drillbit.log
> {code}
> 2015-04-16 22:04:32,029 [2acfce0f-8af4-9786-4799-9180b9bac219:foreman] INFO  
> o.a.drill.exec.work.foreman.Foreman - State change requested.  PENDING --> 
> FAILED
> org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception 
> during fragment initialization: Internal error: Error while applying rule 
> ReduceExpressionsRule[Project], args 
> [rel#54047:ProjectRel.NONE.ANY([]).[](child=rel#54046:Subset#0.ENUMERABLE.ANY([]).[],EXPR$0=SUBSTR(0,
>  1, 'abc'))]
> at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:211) 
> [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>  [na:1.7.0_71]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>  [na:1.7.0_71]
> at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
> Caused by: java.lang.AssertionError: Internal error: Error while applying 
> rule ReduceExpressionsRule[Project], args 
> [rel#54047:ProjectRel.NONE.ANY([]).[](child=rel#54046:Subset#0.ENUMERABLE.ANY([]).[],EXPR$0=SUBSTR(0,
>  1, 'abc'))]
> at org.eigenbase.util.Util.newInternal(Util.java:750) 
> ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> org.eigenbase.relopt.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:246)
>  ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> org.eigenbase.relopt.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:661)
>  ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> net.hydromatic.optiq.tools.Programs$RuleSetProgram.run(Programs.java:165) 
> ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> net.hydromatic.optiq.prepare.PlannerImpl.transform(PlannerImpl.java:278) 
> ~[optiq-core-0.9-drill-r21.jar:na]
> at 
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel(DefaultSqlHandler.java:196)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:137)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:155)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:770) 
> [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:202) 
> [drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> ... 3 common frames omitted
> Caused by: java.lang.RuntimeException: Error in evaluating function of 
> castBIGINT
> at 
> org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator$EvalVisitor.visitFunctionHolderExpression(InterpreterEvaluator.java:323)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.exec.expr.fn.interpreter.InterpreterEvaluator$EvalVisitor.visitFunctionHolderExpression(InterpreterEvaluator.java:147)
>  ~[drill-java-exec-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 
> org.apache.drill.common.expression.FunctionHolderExpression.accept(FunctionHolderExpression.java:47)
>  ~[drill-common-0.9.0-SNAPSHOT-rebuffed.jar:0.9.0-SNAPSHOT]
> at 

[jira] [Commented] (DRILL-3914) Support geospatial queries

2015-10-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14960331#comment-14960331
 ] 

ASF GitHub Bot commented on DRILL-3914:
---

Github user k255 commented on a diff in the pull request:

https://github.com/apache/drill/pull/191#discussion_r42217546
  
--- Diff: 
contrib/gis/src/main/java/org/apache/drill/exec/expr/fn/impl/gis/STAsText.java 
---
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.expr.fn.impl.gis;
+
+import javax.inject.Inject;
+
+import org.apache.drill.exec.expr.DrillSimpleFunc;
+import org.apache.drill.exec.expr.annotations.FunctionTemplate;
+import org.apache.drill.exec.expr.annotations.Output;
+import org.apache.drill.exec.expr.annotations.Param;
+import org.apache.drill.exec.expr.holders.VarBinaryHolder;
+import org.apache.drill.exec.expr.holders.VarCharHolder;
+
+import io.netty.buffer.DrillBuf;
+
+@FunctionTemplate(name = "st_astext", scope = 
FunctionTemplate.FunctionScope.SIMPLE,
+  nulls = FunctionTemplate.NullHandling.NULL_IF_NULL)
+public class STAsText implements DrillSimpleFunc {
+  @Param
+  VarBinaryHolder geom1Param;
+
+  @Output
+  VarCharHolder out;
+
+  @Inject
+  DrillBuf buffer;
+
+  public void setup() {
+  }
+
+  public void eval() {
+com.esri.core.geometry.ogc.OGCGeometry geom1 = 
com.esri.core.geometry.ogc.OGCGeometry
+.fromBinary(geom1Param.buffer.nioBuffer(geom1Param.start, 
geom1Param.end));
+
+String geomWKT = geom1.asText();
+
+int outputSize = geomWKT.getBytes().length;
+out.buffer = buffer.reallocIfNeeded(outputSize);
--- End diff --

Thanks, this was helpful. You're right the next executions failed with 
"Tried to remove unmanaged buffer.". Now it's fixed. Is it also valid to use 
BufferManager.getManagedBuffer(size) somehow (maybe instead of injecting the 
DrillBuf)?


> Support geospatial queries
> --
>
> Key: DRILL-3914
> URL: https://issues.apache.org/jira/browse/DRILL-3914
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Client - JDBC, Functions - Drill
>Reporter: Karol Potocki
>
> Implement spatial query functionality in Drill to provide location based 
> queries and filtering. It could be similar to PostGIS for Postgres and allow 
> queries like:
> select * from
> (select columns[2] as location, columns[4] as lon, columns[3] as lat,
> ST_DWithin(ST_Point(-121.895, 37.339), ST_Point(columns[4], 
> columns[3]), 0.1) as isWithin
> from dfs.`default`.`/home/k255/drill/sample-data/CA-cities.csv`
> )
> where isWithin = true;
> Working proposal is available at http://github.com/k255 (see drill-gis and 
> drill fork).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-3942) IS NOT NULL filter is not pushed pass aggregation

2015-10-16 Thread Julian Hyde (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14960358#comment-14960358
 ] 

Julian Hyde commented on DRILL-3942:


I'd be surprised if FilterAggregateTransposeRule cannot handle this. So I 
wonder what's going on.

> IS NOT NULL filter is not pushed pass aggregation
> -
>
> Key: DRILL-3942
> URL: https://issues.apache.org/jira/browse/DRILL-3942
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Affects Versions: 1.2.0
>Reporter: Victoria Markman
>
> It seems to me that we should be able to do that, x is a grouping column:
> {code}
> 0: jdbc:drill:schema=dfs> explain plan for select x, y, z from ( select 
> ss_sold_date_sk, ss_customer_sk, avg(ss_quantity) from store_sales group by 
> ss_sold_date_sk, ss_customer_sk ) as sq(x, y, z) where x is not null;
> +--+--+
> | text | json |
> +--+--+
> | 00-00Screen
> 00-01  Project(x=[$0], y=[$1], z=[$2])
> 00-02UnionExchange
> 01-01  Project(x=[$0], y=[$1], z=[$2])
> 01-02Project(ss_sold_date_sk=[$0], ss_customer_sk=[$1], 
> EXPR$2=[CAST(/(CastHigh(CASE(=($3, 0), null, $2)), $3)):ANY NOT NULL])
> 01-03  SelectionVectorRemover
> 01-04Filter(condition=[IS NOT NULL($0)])
> 01-05  HashAgg(group=[{0, 1}], agg#0=[$SUM0($2)], 
> agg#1=[$SUM0($3)])
> 01-06Project(ss_sold_date_sk=[$0], ss_customer_sk=[$1], 
> $f2=[$2], $f3=[$3])
> 01-07  HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
> 02-01UnorderedMuxExchange
> 03-01  Project(ss_sold_date_sk=[$0], 
> ss_customer_sk=[$1], $f2=[$2], $f3=[$3], 
> E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
> 03-02HashAgg(group=[{0, 1}], agg#0=[$SUM0($2)], 
> agg#1=[COUNT($2)])
> 03-03  Project(ss_sold_date_sk=[$2], 
> ss_customer_sk=[$1], ss_quantity=[$0])
> 03-04Scan(groupscan=[ParquetGroupScan 
> [entries=[ReadEntryWithPath [path=maprfs:///tpcds1/parquet/store_sales]], 
> selectionRoot=maprfs:/tpcds1/parquet/store_sales, numFiles=1, 
> usedMetadataFile=false, columns=[`ss_sold_date_sk`, `ss_customer_sk`, 
> `ss_quantity`]]])
> {code}
> If I add another not null filter, it is pushed down:
> {code}
> 0: jdbc:drill:schema=dfs> explain plan for select x, y, z from ( select 
> ss_sold_date_sk, ss_customer_sk, avg(ss_quantity) from store_sales group by 
> ss_sold_date_sk, ss_customer_sk ) as sq(x, y, z) where x is not null and y is 
> not null;
> +--+--+
> | text | json |
> +--+--+
> | 00-00Screen
> 00-01  Project(x=[$0], y=[$1], z=[$2])
> 00-02UnionExchange
> 01-01  Project(x=[$0], y=[$1], z=[$2])
> 01-02Project(ss_sold_date_sk=[$0], ss_customer_sk=[$1], 
> EXPR$2=[CAST(/(CastHigh(CASE(=($3, 0), null, $2)), $3)):ANY NOT NULL])
> 01-03  HashAgg(group=[{0, 1}], agg#0=[$SUM0($2)], 
> agg#1=[$SUM0($3)])
> 01-04Project(ss_sold_date_sk=[$0], ss_customer_sk=[$1], 
> $f2=[$2], $f3=[$3])
> 01-05  HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
> 02-01UnorderedMuxExchange
> 03-01  Project(ss_sold_date_sk=[$0], ss_customer_sk=[$1], 
> $f2=[$2], $f3=[$3], E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, 
> hash64AsDouble($0)))])
> 03-02HashAgg(group=[{0, 1}], agg#0=[$SUM0($2)], 
> agg#1=[COUNT($2)])
> 03-03  SelectionVectorRemover
> 03-04Filter(condition=[AND(IS NOT NULL($0), IS 
> NOT NULL($1))])
> 03-05  Project(ss_sold_date_sk=[$2], 
> ss_customer_sk=[$1], ss_quantity=[$0])
> 03-06Scan(groupscan=[ParquetGroupScan 
> [entries=[ReadEntryWithPath [path=maprfs:///tpcds1/parquet/store_sales]], 
> selectionRoot=maprfs:/tpcds1/parquet/store_sales, numFiles=1, 
> usedMetadataFile=false, columns=[`ss_sold_date_sk`, `ss_customer_sk`, 
> `ss_quantity`]]])
> {code}
> IS NULL filter is pushed down:
> {code}
> 0: jdbc:drill:schema=dfs> explain plan for select x, y, z from ( select 
> ss_sold_date_sk, ss_customer_sk, avg(ss_quantity) from store_sales group by 
> ss_sold_date_sk, ss_customer_sk ) as sq(x, y, z) where x is null;
> +--+--+
> | text | json |
> +--+--+
> | 00-00Screen
> 00-01  Project(x=[$0], y=[$1], z=[$2])
> 00-02Project(x=[$0], y=[$1], z=[$2])
> 00-03  Project(ss_sold_date_sk=[$0], ss_customer_sk=[$1], 
> EXPR$2=[CAST(/(CastHigh(CASE(=($3, 0), null, $2)), $3)):ANY NOT NULL])
> 00-04HashAgg(group=[{0, 1}], agg#0=[$SUM0($2)], agg#1=[$SUM0($3)])
> 00-05

[jira] [Created] (DRILL-3943) CannotPlanException caused by ExpressionReduction rule

2015-10-16 Thread Sean Hsuan-Yi Chu (JIRA)
Sean Hsuan-Yi Chu created DRILL-3943:


 Summary: CannotPlanException caused by ExpressionReduction rule
 Key: DRILL-3943
 URL: https://issues.apache.org/jira/browse/DRILL-3943
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning & Optimization
Reporter: Sean Hsuan-Yi Chu
Assignee: Sean Hsuan-Yi Chu
 Fix For: 1.3.0


For a query such as:
{code}
SELECT count(DISTINCT employee_id) as col1,
count((to_number(date_diff(now(), cast(birth_date AS date)),''))) as col2
FROM cp.`employee.json`
{code}
cannot plan exception will be thrown because ExpressionReductionRule does not 
properly simply the call "now()".

This issue is similar to DRILL-2808, but that one focuses on error message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (DRILL-3945) Unable to connect to Haddop file system through apache drill

2015-10-16 Thread ganesh semalty (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-3945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ganesh semalty updated DRILL-3945:
--
Environment: 
Environment
hduser@ubuntu:~/apache-drill-1.1.0/log$ cd

hduser@ubuntu:~$ hadoop version
Hadoop 2.6.0

  was:
hduser@ubuntu:~/apache-drill-1.1.0/log$ cd


hduser@ubuntu:~$ hadoop version
Hadoop 2.6.0
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r 
e3496499ecb8d220fba99dc5ed4c99c8f9e33bb1
Compiled by jenkins on 2014-11-13T21:10Z
Compiled with protoc 2.5.0
>From source with checksum 18e43357c8f927c0695f1e9522859d6a
This command was run using 
/home/hduser/hadoop/share/hadoop/common/hadoop-common-2.6.0.jar


> Unable to connect to Haddop file system through apache drill
> 
>
> Key: DRILL-3945
> URL: https://issues.apache.org/jira/browse/DRILL-3945
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Functions - Drill
>Affects Versions: 1.1.0
> Environment: Environment
> hduser@ubuntu:~/apache-drill-1.1.0/log$ cd
> hduser@ubuntu:~$ hadoop version
> Hadoop 2.6.0
>Reporter: ganesh semalty
>
> Hello,
> I am new to Apache Drill and need some help. I am able to connect to Local 
> File systema nd Hive and query the files/ tables respectively.
> But I want to access file on Hadoop. For that I created a new Storage Plugin, 
> (copied from default dfs) as "hadoop" and changed connection as:
> "connection": "file:///",  ß---  "connection" : 
> "hdfs://192.168.108.133:8020/",
> Now when I am checking data from DRILL Explorer, its giving connection error.
> I tried to run query after selecting: 
> use hadoop;
> 0: jdbc:drill:zk=local> select * from hadoop.`/user/hduser/drill_1.csv`;
> Oct 16, 2015 9:35:15 PM org.apache.calcite.sql.validate.SqlValidatorException 
> 
> SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Table 
> 'hadoop./user/hduser/drill_1.csv' not found
> Oct 16, 2015 9:35:15 PM org.apache.calcite.runtime.CalciteException 
> SEVERE: org.apache.calcite.runtime.CalciteContextException: From line 1, 
> column 15 to line 1, column 20: Table 'hadoop./user/hduser/drill_1.csv' not 
> found
> Error: PARSE ERROR: From line 1, column 15 to line 1, column 20: Table 
> 'hadoop./user/hduser/drill_1.csv' not found
> [Error Id: b97de3f1-d190-48ac-b2f1-a1fb23493fbf on ubuntu:31010] 
> (state=,code=0)
> 0: jdbc:drill:zk=local> 
> Unable to get much help for this on Internet.
> I changed port number to:
> 50070  > namenode which I can successfully access as: 
> http://localhost:50070/dfshealth.html#tab-overview
> 54310  -> /home/hduser/hadoop/etc/hadoop/core-site.xml
> None of these working. Please help



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (DRILL-3945) Unable to connect to Haddop file system through apache drill

2015-10-16 Thread ganesh semalty (JIRA)

 [ 
https://issues.apache.org/jira/browse/DRILL-3945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ganesh semalty updated DRILL-3945:
--
Environment: 
hduser@ubuntu:~/apache-drill-1.1.0/log$ cd


hduser@ubuntu:~$ hadoop version
Hadoop 2.6.0
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r 
e3496499ecb8d220fba99dc5ed4c99c8f9e33bb1
Compiled by jenkins on 2014-11-13T21:10Z
Compiled with protoc 2.5.0
>From source with checksum 18e43357c8f927c0695f1e9522859d6a
This command was run using 
/home/hduser/hadoop/share/hadoop/common/hadoop-common-2.6.0.jar

> Unable to connect to Haddop file system through apache drill
> 
>
> Key: DRILL-3945
> URL: https://issues.apache.org/jira/browse/DRILL-3945
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Functions - Drill
>Affects Versions: 1.1.0
> Environment: hduser@ubuntu:~/apache-drill-1.1.0/log$ cd
> hduser@ubuntu:~$ hadoop version
> Hadoop 2.6.0
> Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r 
> e3496499ecb8d220fba99dc5ed4c99c8f9e33bb1
> Compiled by jenkins on 2014-11-13T21:10Z
> Compiled with protoc 2.5.0
> From source with checksum 18e43357c8f927c0695f1e9522859d6a
> This command was run using 
> /home/hduser/hadoop/share/hadoop/common/hadoop-common-2.6.0.jar
>Reporter: ganesh semalty
>
> Hello,
> I am new to Apache Drill and need some help. I am able to connect to Local 
> File systema nd Hive and query the files/ tables respectively.
> But I want to access file on Hadoop. For that I created a new Storage Plugin, 
> (copied from default dfs) as "hadoop" and changed connection as:
> "connection": "file:///",  ß---  "connection" : 
> "hdfs://192.168.108.133:8020/",
> Now when I am checking data from DRILL Explorer, its giving connection error.
> I tried to run query after selecting: 
> use hadoop;
> 0: jdbc:drill:zk=local> select * from hadoop.`/user/hduser/drill_1.csv`;
> Oct 16, 2015 9:35:15 PM org.apache.calcite.sql.validate.SqlValidatorException 
> 
> SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Table 
> 'hadoop./user/hduser/drill_1.csv' not found
> Oct 16, 2015 9:35:15 PM org.apache.calcite.runtime.CalciteException 
> SEVERE: org.apache.calcite.runtime.CalciteContextException: From line 1, 
> column 15 to line 1, column 20: Table 'hadoop./user/hduser/drill_1.csv' not 
> found
> Error: PARSE ERROR: From line 1, column 15 to line 1, column 20: Table 
> 'hadoop./user/hduser/drill_1.csv' not found
> [Error Id: b97de3f1-d190-48ac-b2f1-a1fb23493fbf on ubuntu:31010] 
> (state=,code=0)
> 0: jdbc:drill:zk=local> 
> Unable to get much help for this on Internet.
> I changed port number to:
> 50070  > namenode which I can successfully access as: 
> http://localhost:50070/dfshealth.html#tab-overview
> 54310  -> /home/hduser/hadoop/etc/hadoop/core-site.xml
> None of these working. Please help



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-3945) Unable to connect to Haddop file system through apache drill

2015-10-16 Thread ganesh semalty (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14961755#comment-14961755
 ] 

ganesh semalty commented on DRILL-3945:
---

Environment
hduser@ubuntu:~/apache-drill-1.1.0/log$ cd

hduser@ubuntu:~$ hadoop version
Hadoop 2.6.0


> Unable to connect to Haddop file system through apache drill
> 
>
> Key: DRILL-3945
> URL: https://issues.apache.org/jira/browse/DRILL-3945
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Functions - Drill
>Affects Versions: 1.1.0
> Environment: hduser@ubuntu:~/apache-drill-1.1.0/log$ cd
> hduser@ubuntu:~$ hadoop version
> Hadoop 2.6.0
> Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r 
> e3496499ecb8d220fba99dc5ed4c99c8f9e33bb1
> Compiled by jenkins on 2014-11-13T21:10Z
> Compiled with protoc 2.5.0
> From source with checksum 18e43357c8f927c0695f1e9522859d6a
> This command was run using 
> /home/hduser/hadoop/share/hadoop/common/hadoop-common-2.6.0.jar
>Reporter: ganesh semalty
>
> Hello,
> I am new to Apache Drill and need some help. I am able to connect to Local 
> File systema nd Hive and query the files/ tables respectively.
> But I want to access file on Hadoop. For that I created a new Storage Plugin, 
> (copied from default dfs) as "hadoop" and changed connection as:
> "connection": "file:///",  ß---  "connection" : 
> "hdfs://192.168.108.133:8020/",
> Now when I am checking data from DRILL Explorer, its giving connection error.
> I tried to run query after selecting: 
> use hadoop;
> 0: jdbc:drill:zk=local> select * from hadoop.`/user/hduser/drill_1.csv`;
> Oct 16, 2015 9:35:15 PM org.apache.calcite.sql.validate.SqlValidatorException 
> 
> SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Table 
> 'hadoop./user/hduser/drill_1.csv' not found
> Oct 16, 2015 9:35:15 PM org.apache.calcite.runtime.CalciteException 
> SEVERE: org.apache.calcite.runtime.CalciteContextException: From line 1, 
> column 15 to line 1, column 20: Table 'hadoop./user/hduser/drill_1.csv' not 
> found
> Error: PARSE ERROR: From line 1, column 15 to line 1, column 20: Table 
> 'hadoop./user/hduser/drill_1.csv' not found
> [Error Id: b97de3f1-d190-48ac-b2f1-a1fb23493fbf on ubuntu:31010] 
> (state=,code=0)
> 0: jdbc:drill:zk=local> 
> Unable to get much help for this on Internet.
> I changed port number to:
> 50070  > namenode which I can successfully access as: 
> http://localhost:50070/dfshealth.html#tab-overview
> 54310  -> /home/hduser/hadoop/etc/hadoop/core-site.xml
> None of these working. Please help



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (DRILL-3945) Unable to connect to Haddop file system through apache drill

2015-10-16 Thread ganesh semalty (JIRA)
ganesh semalty created DRILL-3945:
-

 Summary: Unable to connect to Haddop file system through apache 
drill
 Key: DRILL-3945
 URL: https://issues.apache.org/jira/browse/DRILL-3945
 Project: Apache Drill
  Issue Type: Bug
  Components: Functions - Drill
Affects Versions: 1.1.0
Reporter: ganesh semalty


Hello,

I am new to Apache Drill and need some help. I am able to connect to Local File 
systema nd Hive and query the files/ tables respectively.

But I want to access file on Hadoop. For that I created a new Storage Plugin, 
(copied from default dfs) as "hadoop" and changed connection as:

"connection": "file:///",  ß---  "connection" : 
"hdfs://192.168.108.133:8020/",


Now when I am checking data from DRILL Explorer, its giving connection error.
I tried to run query after selecting: 
use hadoop;
0: jdbc:drill:zk=local> select * from hadoop.`/user/hduser/drill_1.csv`;
Oct 16, 2015 9:35:15 PM org.apache.calcite.sql.validate.SqlValidatorException 

SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Table 
'hadoop./user/hduser/drill_1.csv' not found
Oct 16, 2015 9:35:15 PM org.apache.calcite.runtime.CalciteException 
SEVERE: org.apache.calcite.runtime.CalciteContextException: From line 1, column 
15 to line 1, column 20: Table 'hadoop./user/hduser/drill_1.csv' not found
Error: PARSE ERROR: From line 1, column 15 to line 1, column 20: Table 
'hadoop./user/hduser/drill_1.csv' not found


[Error Id: b97de3f1-d190-48ac-b2f1-a1fb23493fbf on ubuntu:31010] (state=,code=0)
0: jdbc:drill:zk=local> 


Unable to get much help for this on Internet.
I changed port number to:
50070  > namenode which I can successfully access as: 
http://localhost:50070/dfshealth.html#tab-overview

54310  -> /home/hduser/hadoop/etc/hadoop/core-site.xml


None of these working. Please help



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-3943) CannotPlanException caused by ExpressionReductionRule

2015-10-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14961069#comment-14961069
 ] 

ASF GitHub Bot commented on DRILL-3943:
---

Github user jaltekruse commented on the pull request:

https://github.com/apache/drill/pull/206#issuecomment-148780579
  
+1


> CannotPlanException caused by ExpressionReductionRule
> -
>
> Key: DRILL-3943
> URL: https://issues.apache.org/jira/browse/DRILL-3943
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Reporter: Sean Hsuan-Yi Chu
>Assignee: Jason Altekruse
> Fix For: 1.3.0
>
>
> For a query such as:
> {code}
> SELECT count(DISTINCT employee_id) as col1,
> count((to_number(date_diff(now(), cast(birth_date AS date)),''))) as col2
> FROM cp.`employee.json`
> {code}
> cannot plan exception will be thrown because ExpressionReductionRule does not 
> properly simply the call "now()".
> This issue is similar to DRILL-2808, but that one focuses on error message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)