[jira] [Created] (DRILL-3226) Upper and lower casing doesn't work correctly on non-ASCII characters

2015-05-31 Thread Ted Dunning (JIRA)
Ted Dunning created DRILL-3226:
--

 Summary: Upper and lower casing doesn't work correctly on 
non-ASCII characters
 Key: DRILL-3226
 URL: https://issues.apache.org/jira/browse/DRILL-3226
 Project: Apache Drill
  Issue Type: Bug
Reporter: Ted Dunning


{code}
0: jdbc:drill:zk=local> select z, lower(z), upper(z) from 
dfs.root.`/Users/tdunning/tmp/data.json`;
+--+-+-+
|  z   | EXPR$1  | EXPR$2  |
+--+-+-+
| åäö  | åäö | åäö |
| aBc  | abc | ABC |
+--+-+-+
{code}
Expected result would be
{code}
+--+-+-+
|  z   | EXPR$1  | EXPR$2  |
+--+-+-+
| åäö  | åäö | ÅÄÖ |
| aBc  | abc | ABC |
+--+-+-+
{code}




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


[jira] [Updated] (DRILL-3140) Doc.: Fixed-positioned(?) menu bar hides data in printing

2015-05-31 Thread Kristine Hahn (JIRA)

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

Kristine Hahn updated DRILL-3140:
-
Assignee: (was: Bridget Bevens)

> Doc.: Fixed-positioned(?) menu bar hides data in printing
> -
>
> Key: DRILL-3140
> URL: https://issues.apache.org/jira/browse/DRILL-3140
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Documentation
>Reporter: Tomer Shiran
>
> The top menu bar that won't scroll away (to let the user see more of the 
> requested text) also breaks printing:  
> At the top of every printed page other than the first, that bar covers the 
> text (or image content) at the top of the page.
> (Also, it doesn't appear at the top of the first printed page--the main place 
> you'd expect it to appear.)



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


[jira] [Closed] (DRILL-3131) Old Confluence wiki pages should note old, have pointers (links) to new pages

2015-05-31 Thread Kristine Hahn (JIRA)

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

Kristine Hahn closed DRILL-3131.

Resolution: Fixed

The wiki is history.

> Old Confluence wiki pages should note old, have pointers (links) to new pages
> -
>
> Key: DRILL-3131
> URL: https://issues.apache.org/jira/browse/DRILL-3131
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Documentation
>Reporter: Daniel Barclay (Drill)
>Assignee: Bridget Bevens
>
> In the old Drill documentation on the Confluence wiki, each page should have 
> some note near the top making clear that it is no longer current and pointing 
> to (having a link to) the corresponding new page or section.
> Rationale:  Drill users are still referring to those old pages, not realizing 
> they are obsolete, and making new links (e.g., in e-mail archives and web 
> forums) to those pages.
> Note that this is not a request to delete the Confluence wiki pages--since 
> there are existing links "out in the wild" to those pages, something should 
> still remain at their URLs (at least the old page with a link to the new 
> site, preferrably the old page (possibly with any obsolete information 
> removed) with a link to the corresponding new page, and maybe ideally an 
> automatic redirection to the corresponding new page).



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


[jira] [Created] (DRILL-3227) Planning Error : Self join between a view and underlying file fails to plan when the view contains missing columns

2015-05-31 Thread Rahul Challapalli (JIRA)
Rahul Challapalli created DRILL-3227:


 Summary: Planning Error : Self join between a view and underlying 
file fails to plan when the view contains missing columns
 Key: DRILL-3227
 URL: https://issues.apache.org/jira/browse/DRILL-3227
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning & Optimization
Reporter: Rahul Challapalli
Assignee: Jinfeng Ni


git.commit.id.abbrev=6f54223

The below view is created with non-existent columns
{code}
create or replace view v1(x,y) as select col1, col2 from `a.json`;
+---+---+
|  ok   |  summary  |
+---+---+
| true  | View 'v1' created successfully in 'dfs.drillTestDirViews' schema  |
+---+---+
1 row selected (0.142 seconds)
0: jdbc:drill:schema=dfs_eea> select * from v1;
+---+---+
|   x   |   y   |
+---+---+
| null  | null  |
+---+---+
1 row selected (0.129 seconds)
{code}

Now when I try to join the view with the underlying file, I get a planning error
{code}
0: jdbc:drill:schema=dfs_eea> select c1 from `a.json` a inner join v1 on a.c1 = 
v1.x;
Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
Unexpected exception during fragment initialization: null


[Error Id: d38b4e61-d56f-4cd6-97dd-787deaebd33f on qa-node191.qa.lab:31010] 
(state=,code=0)

explain plan for select c1 from `a.json` a inner join v1 on a.c1 = v1.x;
Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
Unexpected exception during fragment initialization: null


[Error Id: af10a933-ddf2-4bca-94a7-7b0383c9a1d4 on qa-node191.qa.lab:31010] 
(state=,code=0)
{code}

I attached the data and the error log



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


[jira] [Updated] (DRILL-3227) Planning Error : Self join between a view and underlying file fails to plan when the view contains missing columns

2015-05-31 Thread Rahul Challapalli (JIRA)

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

Rahul Challapalli updated DRILL-3227:
-
Attachment: error.log

Below is the data :
{code}
{
  "c1" : 1,
  "c2" : 2
}
{code}

> Planning Error : Self join between a view and underlying file fails to plan 
> when the view contains missing columns
> --
>
> Key: DRILL-3227
> URL: https://issues.apache.org/jira/browse/DRILL-3227
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Reporter: Rahul Challapalli
>Assignee: Jinfeng Ni
> Attachments: error.log
>
>
> git.commit.id.abbrev=6f54223
> The below view is created with non-existent columns
> {code}
> create or replace view v1(x,y) as select col1, col2 from `a.json`;
> +---+---+
> |  ok   |  summary  |
> +---+---+
> | true  | View 'v1' created successfully in 'dfs.drillTestDirViews' schema  |
> +---+---+
> 1 row selected (0.142 seconds)
> 0: jdbc:drill:schema=dfs_eea> select * from v1;
> +---+---+
> |   x   |   y   |
> +---+---+
> | null  | null  |
> +---+---+
> 1 row selected (0.129 seconds)
> {code}
> Now when I try to join the view with the underlying file, I get a planning 
> error
> {code}
> 0: jdbc:drill:schema=dfs_eea> select c1 from `a.json` a inner join v1 on a.c1 
> = v1.x;
> Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
> Unexpected exception during fragment initialization: null
> [Error Id: d38b4e61-d56f-4cd6-97dd-787deaebd33f on qa-node191.qa.lab:31010] 
> (state=,code=0)
> explain plan for select c1 from `a.json` a inner join v1 on a.c1 = v1.x;
> Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
> Unexpected exception during fragment initialization: null
> [Error Id: af10a933-ddf2-4bca-94a7-7b0383c9a1d4 on qa-node191.qa.lab:31010] 
> (state=,code=0)
> {code}
> I attached the data and the error log



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


[jira] [Commented] (DRILL-3227) Planning Error : Self join between a view and underlying file fails to plan when the view contains missing columns

2015-05-31 Thread Rahul Challapalli (JIRA)

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

Rahul Challapalli commented on DRILL-3227:
--

Even when the view is created from the available columns from the data file, we 
do encounter this exception
{code}
create or replace view v1(x,y) as select c1, c2 from `a.json`;
+---+---+
|  ok   |summary
|
+---+---+
| true  | View 'v2830' replaced successfully in 'dfs.drillTestDirViews' schema  
|
+---+---+
1 row selected (0.13 seconds)

select a.c1 from `a.json` a inner join v2830 on a.c1 = v2830.x;
Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
Unexpected exception during fragment initialization: null


[Error Id: f5e6c2e8-5be3-42bb-bbed-56f717d8a997 on qa-node191.qa.lab:31010] 
(state=,code=0)
{code}

Ironically the below query works and give wrong results. This is DRILL-2830
{code}
select a.c1 from `a.json` a inner join v2830 on a.c1 = v2830.y;
+-+
| c1  |
+-+
| 1   |
+-+
1 row selected (0.253 seconds)
{code}

> Planning Error : Self join between a view and underlying file fails to plan 
> when the view contains missing columns
> --
>
> Key: DRILL-3227
> URL: https://issues.apache.org/jira/browse/DRILL-3227
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Reporter: Rahul Challapalli
>Assignee: Jinfeng Ni
> Attachments: error.log
>
>
> git.commit.id.abbrev=6f54223
> The below view is created with non-existent columns
> {code}
> create or replace view v1(x,y) as select col1, col2 from `a.json`;
> +---+---+
> |  ok   |  summary  |
> +---+---+
> | true  | View 'v1' created successfully in 'dfs.drillTestDirViews' schema  |
> +---+---+
> 1 row selected (0.142 seconds)
> 0: jdbc:drill:schema=dfs_eea> select * from v1;
> +---+---+
> |   x   |   y   |
> +---+---+
> | null  | null  |
> +---+---+
> 1 row selected (0.129 seconds)
> {code}
> Now when I try to join the view with the underlying file, I get a planning 
> error
> {code}
> 0: jdbc:drill:schema=dfs_eea> select c1 from `a.json` a inner join v1 on a.c1 
> = v1.x;
> Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
> Unexpected exception during fragment initialization: null
> [Error Id: d38b4e61-d56f-4cd6-97dd-787deaebd33f on qa-node191.qa.lab:31010] 
> (state=,code=0)
> explain plan for select c1 from `a.json` a inner join v1 on a.c1 = v1.x;
> Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
> Unexpected exception during fragment initialization: null
> [Error Id: af10a933-ddf2-4bca-94a7-7b0383c9a1d4 on qa-node191.qa.lab:31010] 
> (state=,code=0)
> {code}
> I attached the data and the error log



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


[jira] [Commented] (DRILL-3227) Planning Error : Self join between a view and underlying file fails to plan when the view contains missing columns

2015-05-31 Thread Rahul Challapalli (JIRA)

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

Rahul Challapalli commented on DRILL-3227:
--

The equivalent subqueries however yield the right results
{code}
0: jdbc:drill:schema=dfs_eea> select a.c1 from `a.json` a inner join (select 
t.c1 x, t.c2 y from `a.json` t) v1 on a.c1 = v1.y;
+-+
| c1  |
+-+
+-+
No rows selected (0.205 seconds)
0: jdbc:drill:schema=dfs_eea> select a.c1 from `a.json` a inner join (select 
t.c1 x, t.c2 y from `a.json` t) v1 on a.c1 = v1.x;
+-+
| c1  |
+-+
| 1   |
+-+
1 row selected (0.217 seconds)
{code}

> Planning Error : Self join between a view and underlying file fails to plan 
> when the view contains missing columns
> --
>
> Key: DRILL-3227
> URL: https://issues.apache.org/jira/browse/DRILL-3227
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Query Planning & Optimization
>Reporter: Rahul Challapalli
>Assignee: Jinfeng Ni
> Attachments: error.log
>
>
> git.commit.id.abbrev=6f54223
> The below view is created with non-existent columns
> {code}
> create or replace view v1(x,y) as select col1, col2 from `a.json`;
> +---+---+
> |  ok   |  summary  |
> +---+---+
> | true  | View 'v1' created successfully in 'dfs.drillTestDirViews' schema  |
> +---+---+
> 1 row selected (0.142 seconds)
> 0: jdbc:drill:schema=dfs_eea> select * from v1;
> +---+---+
> |   x   |   y   |
> +---+---+
> | null  | null  |
> +---+---+
> 1 row selected (0.129 seconds)
> {code}
> Now when I try to join the view with the underlying file, I get a planning 
> error
> {code}
> 0: jdbc:drill:schema=dfs_eea> select c1 from `a.json` a inner join v1 on a.c1 
> = v1.x;
> Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
> Unexpected exception during fragment initialization: null
> [Error Id: d38b4e61-d56f-4cd6-97dd-787deaebd33f on qa-node191.qa.lab:31010] 
> (state=,code=0)
> explain plan for select c1 from `a.json` a inner join v1 on a.c1 = v1.x;
> Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
> Unexpected exception during fragment initialization: null
> [Error Id: af10a933-ddf2-4bca-94a7-7b0383c9a1d4 on qa-node191.qa.lab:31010] 
> (state=,code=0)
> {code}
> I attached the data and the error log



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


[jira] [Updated] (DRILL-3200) Add Window functions: ROW_NUMBER, RANK, PERCENT_RANK, DENSE_RANK and CUME_DIST

2015-05-31 Thread Deneche A. Hakim (JIRA)

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

Deneche A. Hakim updated DRILL-3200:

Component/s: Execution - Relational Operators

> Add Window functions: ROW_NUMBER, RANK, PERCENT_RANK, DENSE_RANK and CUME_DIST
> --
>
> Key: DRILL-3200
> URL: https://issues.apache.org/jira/browse/DRILL-3200
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Execution - Relational Operators
>Reporter: Deneche A. Hakim
>Assignee: Deneche A. Hakim
> Fix For: 1.1.0
>
>
> add support for the following window functions:
> - ROW_NUMBER
> - RANK
> - DENSE_RANK
> - PERCENT_RANK
> - CUME_DIST



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


[jira] [Assigned] (DRILL-3150) Error when filtering non-existent field with a string

2015-05-31 Thread Adam Gilmore (JIRA)

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

Adam Gilmore reassigned DRILL-3150:
---

Assignee: Adam Gilmore  (was: Sudheesh Katkam)

> Error when filtering non-existent field with a string
> -
>
> Key: DRILL-3150
> URL: https://issues.apache.org/jira/browse/DRILL-3150
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Execution - Relational Operators
>Affects Versions: 1.0.0
>Reporter: Adam Gilmore
>Assignee: Adam Gilmore
>Priority: Critical
> Fix For: 1.1.0
>
>
> The following query throws an exception:
> {code}
> select count(*) from cp.`employee.json` where `blah` = 'test'
> {code}
> "blah" does not exist as a field in the JSON.  The expected behaviour would 
> be to filter out all rows as that field is not present (thus cannot equal the 
> string 'test').
> Instead, the following exception occurs:
> {code}
> org.apache.drill.common.exceptions.UserRemoteException: SYSTEM ERROR: test
> Fragment 0:0
> [Error Id: 5d6c9a82-8f87-41b2-a496-67b360302b76 on 
> ip-10-1-50-208.ec2.internal:31010]
> {code}
> Apart from the fact the real error message is hidden, the issue is that we're 
> trying to cast the varchar to int ('test' to an int).  This seems to be 
> because the projection out of the scan when a field is not found becomes 
> INT:OPTIONAL.
> The filter should not fail on this - if the varchar fails to convert to an 
> int, the filter should just simply not allow any records through.



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


[jira] [Updated] (DRILL-3150) Error when filtering non-existent field with a string

2015-05-31 Thread Adam Gilmore (JIRA)

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

Adam Gilmore updated DRILL-3150:

Attachment: DRILL-3150.1.patch.txt

Here's a proposed patch for the issue.  Basically, the issue is when 
materializing the LogicalExpression, it adds casts to certain aspects of it.  
In the query specified above, it will try to cast the string "test" to an int 
(INT OPTIONAL seems to be the default typing when a field is not found in the 
schema of the table).  Of course, the cast fails and thus the exception.

I've added generated "tryCast" functions for certain types.  This will return a 
NullableTypeHolder with isSet = 0 when casting fails.  This gets around the 
issue.

This also affected an old bug DRILL-2590 whereby an expected cast failure would 
occur.  This no longer occurs as I've implemented casting a BIT to INT or 
BIGINT (true = 1, false = 0).

Finally, the tryCast is as simple as catching the exception at the moment.  We 
would probably want to optimize that so it doesn't actually throw and catch 
exceptions.

These are some quite significant changes so I welcome feedback/thoughts.

The only other idea I had was to set the default missing field type to, say, 
VARCHAR OPTIONAL, but then this would still cause failures when there is a 
valid integer field (and you try to compare it to a non-numeric string).

> Error when filtering non-existent field with a string
> -
>
> Key: DRILL-3150
> URL: https://issues.apache.org/jira/browse/DRILL-3150
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Execution - Relational Operators
>Affects Versions: 1.0.0
>Reporter: Adam Gilmore
>Assignee: Adam Gilmore
>Priority: Critical
> Fix For: 1.1.0
>
> Attachments: DRILL-3150.1.patch.txt
>
>
> The following query throws an exception:
> {code}
> select count(*) from cp.`employee.json` where `blah` = 'test'
> {code}
> "blah" does not exist as a field in the JSON.  The expected behaviour would 
> be to filter out all rows as that field is not present (thus cannot equal the 
> string 'test').
> Instead, the following exception occurs:
> {code}
> org.apache.drill.common.exceptions.UserRemoteException: SYSTEM ERROR: test
> Fragment 0:0
> [Error Id: 5d6c9a82-8f87-41b2-a496-67b360302b76 on 
> ip-10-1-50-208.ec2.internal:31010]
> {code}
> Apart from the fact the real error message is hidden, the issue is that we're 
> trying to cast the varchar to int ('test' to an int).  This seems to be 
> because the projection out of the scan when a field is not found becomes 
> INT:OPTIONAL.
> The filter should not fail on this - if the varchar fails to convert to an 
> int, the filter should just simply not allow any records through.



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


[jira] [Commented] (DRILL-3216) Fix existing INFORMATION_SCHEMA.COLUMNS columns

2015-05-31 Thread Daniel Barclay (Drill) (JIRA)

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

Daniel Barclay (Drill) commented on DRILL-3216:
---

Note:  Regarding INFORMATION_SCHEMA.COLUMNS.DATA_TYPE:

Need to analyze:
1) ISO/IEC 9075-2:2011(E) section 9.9, "Type name determination" (which defines 
some kind of type name (an  return value) which uses short forms, 
e.g., "VARCHAR"), and uses of (explicit or implement references to) it, versus 
2) DEFINITION_SCHEMA's DATA_TYPE_DESCRIPTOR base table's constraint  
DATA_TYPE_DESCRIPTOR_DATA_TYPE_CHECK_COMBINATIONS (which clearly requires long 
forms, e.g., 'CHARACTER VARYING').

> Fix existing INFORMATION_SCHEMA.COLUMNS columns
> ---
>
> Key: DRILL-3216
> URL: https://issues.apache.org/jira/browse/DRILL-3216
> Project: Apache Drill
>  Issue Type: Bug
>Reporter: Daniel Barclay (Drill)
>
> [Editing in progress]
> Change logical null from {{-1}} to actual {{NULL}}:
> - Change column {{CHARACTER_MAXIMUM_LENGTH}}.
> - Change column {{NUMERIC_PRECISION}}.
> - Change column {{NUMERIC_PRECISION_RADIX}}.
> - Change column {{NUMERIC_SCALE}}.
> Change column {{ORDINAL_POSITION}} from zero-based to one-based.
> Move {{CHAR}} length from {{NUMERIC_PRECISION}} to 
> {{CHARACTER_MAXIMUM_LENGTH}} (same as {{VARCHAR}} length):
> - Change column {{NUMERIC_PRECISION}} from length to logical null for CHAR.
> - Change column {{CHARACTER_MAXIMUM_LENGTH}} from logical null to length for 
> CHAR.
> Move {{BINARY}} and {{VARBINARY}} length from {{NUMERIC_PRECISION}} to 
> {{CHARACTER_MAXIMUM_LENGTH}} (same as CHAR and VARCHAR length):
> - Change column {{NUMERIC_PRECISION}} from length to logical null for BINARY 
> and VARBINARY.
> - Change column {{CHARACTER_MAXIMUM_LENGTH}} from logical null to length for 
> BINARY and VARBINARY.
> Fix data type names "INTERVAL_DAY_TIME" and "INTERVAL_YEAR_MONTH" to 
> "INTERVAL":
> - Change column {{DATA_TYPE}} to list "INTERVAL" for interval types.
> - Add column {{INTERVAL_TYPE}}.
> To correct ordinal position of some existing columns:
> - Add column {{COLUMN_DEFAULT}}.
> - Add column {{CHARACTER_OCTET_LENGTH}}.
> - Reorder column {{NUMERIC_PRECISION}}.
> Move date/time and interval precisions from {{NUMERIC_PRECISION}} to 
> {{DATETIME_PRECISION}} and {{INTERVAL_PRECISION}}:
> - Change column {{NUMERIC_PRECISION}} to logically null for date/time and 
> interval types.
> - Add column {{DATETIME_PRECISION}}.
> - Add column {{INTERVAL_PRECISION}}.
> Implement {{NUMERIC_PRECISION_RADIX}}:
> - Change column {{NUMERIC_PRECISION_RADIX}} from always logically null to 
> appropriate values (2, 10, NULL).
> Add missing numeric precision and scale values (for non-DECIMAL types):
> - Change NUMERIC_SCALE from logical null to zero for integer types.
> - Change NUMERIC_PRECISION from logical null to precision for non-DECIMAL 
> numeric types.



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