[jira] [Commented] (DRILL-3301) ILIKE does not support escape characters.

2015-06-16 Thread Patrick Toole (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14588037#comment-14588037
 ] 

Patrick Toole commented on DRILL-3301:
--

See DRILL-2658 for a syntax description in the comments.

 ILIKE does not support escape characters.
 -

 Key: DRILL-3301
 URL: https://issues.apache.org/jira/browse/DRILL-3301
 Project: Apache Drill
  Issue Type: Bug
Reporter: Patrick Toole

 The like operator properly supports escaping characters. Because the ILIKE is 
 implemented as a function, it does not support escaping.
 The grammar needs to be updated to accept ILIKE in the same locations as LIKE.



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


[jira] [Created] (DRILL-3301) ILIKE does not support escape characters.

2015-06-16 Thread Patrick Toole (JIRA)
Patrick Toole created DRILL-3301:


 Summary: ILIKE does not support escape characters.
 Key: DRILL-3301
 URL: https://issues.apache.org/jira/browse/DRILL-3301
 Project: Apache Drill
  Issue Type: Bug
Reporter: Patrick Toole


The like operator properly supports escaping characters. Because the ILIKE is 
implemented as a function, it does not support escaping.

The grammar needs to be updated to accept ILIKE in the same locations as LIKE.




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


[jira] [Commented] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Deneche A. Hakim (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14588248#comment-14588248
 ] 

Deneche A. Hakim commented on DRILL-3298:
-

{{test.res}} doesn't seem to match the query, [~vicky] did you attach the wrong 
file ?

 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 URL: https://issues.apache.org/jira/browse/DRILL-3298
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Chris Westin
Priority: Critical
  Labels: window_function
 Attachments: j1.tar, test.res


 This query returns incorrect result when planner.slice_target = 1
 {code}
 select
 j1.c_integer,
 sum(j1.c_integer) over w
 from j1
 window  w as (order by c_integer desc)
 order by
 1, 2;
 {code}
 Query plan with planner.slice_target = 1
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
 01-01  SelectionVectorRemover
 01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 01-03  Project(c_integer=[$0], EXPR$1=[$1])
 01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
 02-01  UnorderedMuxExchange
 03-01Project(c_integer=[$0], EXPR$1=[$1], 
 E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
 03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
 CAST($2):ANY, null)])
 03-03Window(window#0=[window(partition {} order by [0 
 DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 03-04  SelectionVectorRemover
 03-05Sort(sort0=[$0], dir0=[DESC])
 03-06  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Query plan with planner.slice_target = 10;
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SelectionVectorRemover
 00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
 null)])
 00-05  Window(window#0=[window(partition {} order by [0 DESC] 
 range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 00-06SelectionVectorRemover
 00-07  Sort(sort0=[$0], dir0=[DESC])
 00-08Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Attached:
 * table j1
 * test.res - result generated with postgres



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


[jira] [Commented] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Deneche A. Hakim (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14588432#comment-14588432
 ] 

Deneche A. Hakim commented on DRILL-3298:
-

I did some tests, looks like the results are correct when we use 
{{slice_target=1}} but the results are incorrect when {{slice_target=1}}

Investigating further

 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 URL: https://issues.apache.org/jira/browse/DRILL-3298
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Chris Westin
Priority: Critical
  Labels: window_function
 Attachments: j1.tar, test.res


 This query returns incorrect result when planner.slice_target = 1
 {code}
 select
 j1.c_integer,
 sum(j1.c_integer) over w
 from j1
 window  w as (order by c_integer desc)
 order by
 1, 2;
 {code}
 Query plan with planner.slice_target = 1
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
 01-01  SelectionVectorRemover
 01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 01-03  Project(c_integer=[$0], EXPR$1=[$1])
 01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
 02-01  UnorderedMuxExchange
 03-01Project(c_integer=[$0], EXPR$1=[$1], 
 E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
 03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
 CAST($2):ANY, null)])
 03-03Window(window#0=[window(partition {} order by [0 
 DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 03-04  SelectionVectorRemover
 03-05Sort(sort0=[$0], dir0=[DESC])
 03-06  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Query plan with planner.slice_target = 10;
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SelectionVectorRemover
 00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
 null)])
 00-05  Window(window#0=[window(partition {} order by [0 DESC] 
 range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 00-06SelectionVectorRemover
 00-07  Sort(sort0=[$0], dir0=[DESC])
 00-08Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Attached:
 * table j1
 * test.res - result generated with postgres



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


[jira] [Commented] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Victoria Markman (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14588391#comment-14588391
 ] 

Victoria Markman commented on DRILL-3298:
-

My apologies, wrong file was attached.

 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 URL: https://issues.apache.org/jira/browse/DRILL-3298
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Chris Westin
Priority: Critical
  Labels: window_function
 Attachments: j1.tar


 This query returns incorrect result when planner.slice_target = 1
 {code}
 select
 j1.c_integer,
 sum(j1.c_integer) over w
 from j1
 window  w as (order by c_integer desc)
 order by
 1, 2;
 {code}
 Query plan with planner.slice_target = 1
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
 01-01  SelectionVectorRemover
 01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 01-03  Project(c_integer=[$0], EXPR$1=[$1])
 01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
 02-01  UnorderedMuxExchange
 03-01Project(c_integer=[$0], EXPR$1=[$1], 
 E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
 03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
 CAST($2):ANY, null)])
 03-03Window(window#0=[window(partition {} order by [0 
 DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 03-04  SelectionVectorRemover
 03-05Sort(sort0=[$0], dir0=[DESC])
 03-06  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Query plan with planner.slice_target = 10;
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SelectionVectorRemover
 00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
 null)])
 00-05  Window(window#0=[window(partition {} order by [0 DESC] 
 range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 00-06SelectionVectorRemover
 00-07  Sort(sort0=[$0], dir0=[DESC])
 00-08Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Attached:
 * table j1
 * test.res - result generated with postgres



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


[jira] [Updated] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Victoria Markman (JIRA)

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

Victoria Markman updated DRILL-3298:

Attachment: (was: test.res)

 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 URL: https://issues.apache.org/jira/browse/DRILL-3298
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Chris Westin
Priority: Critical
  Labels: window_function
 Attachments: j1.tar


 This query returns incorrect result when planner.slice_target = 1
 {code}
 select
 j1.c_integer,
 sum(j1.c_integer) over w
 from j1
 window  w as (order by c_integer desc)
 order by
 1, 2;
 {code}
 Query plan with planner.slice_target = 1
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
 01-01  SelectionVectorRemover
 01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 01-03  Project(c_integer=[$0], EXPR$1=[$1])
 01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
 02-01  UnorderedMuxExchange
 03-01Project(c_integer=[$0], EXPR$1=[$1], 
 E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
 03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
 CAST($2):ANY, null)])
 03-03Window(window#0=[window(partition {} order by [0 
 DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 03-04  SelectionVectorRemover
 03-05Sort(sort0=[$0], dir0=[DESC])
 03-06  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Query plan with planner.slice_target = 10;
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SelectionVectorRemover
 00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
 null)])
 00-05  Window(window#0=[window(partition {} order by [0 DESC] 
 range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 00-06SelectionVectorRemover
 00-07  Sort(sort0=[$0], dir0=[DESC])
 00-08Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Attached:
 * table j1
 * test.res - result generated with postgres



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


[jira] [Updated] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Victoria Markman (JIRA)

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

Victoria Markman updated DRILL-3298:

Attachment: (was: test.res)

 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 URL: https://issues.apache.org/jira/browse/DRILL-3298
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Chris Westin
Priority: Critical
  Labels: window_function
 Attachments: j1.tar, test.res


 This query returns incorrect result when planner.slice_target = 1
 {code}
 select
 j1.c_integer,
 sum(j1.c_integer) over w
 from j1
 window  w as (order by c_integer desc)
 order by
 1, 2;
 {code}
 Query plan with planner.slice_target = 1
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
 01-01  SelectionVectorRemover
 01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 01-03  Project(c_integer=[$0], EXPR$1=[$1])
 01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
 02-01  UnorderedMuxExchange
 03-01Project(c_integer=[$0], EXPR$1=[$1], 
 E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
 03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
 CAST($2):ANY, null)])
 03-03Window(window#0=[window(partition {} order by [0 
 DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 03-04  SelectionVectorRemover
 03-05Sort(sort0=[$0], dir0=[DESC])
 03-06  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Query plan with planner.slice_target = 10;
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SelectionVectorRemover
 00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
 null)])
 00-05  Window(window#0=[window(partition {} order by [0 DESC] 
 range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 00-06SelectionVectorRemover
 00-07  Sort(sort0=[$0], dir0=[DESC])
 00-08Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Attached:
 * table j1
 * test.res - result generated with postgres



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


[jira] [Commented] (DRILL-3301) ILIKE does not support escape characters.

2015-06-16 Thread Steven Phillips (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14588412#comment-14588412
 ] 

Steven Phillips commented on DRILL-3301:


Escape is supported, e.g.:

ilike(a, 'abc#t, '#')

I don't think we are planning on updating the syntax to support the LIKE 
syntax, since that probably requires modifying Calcite, and ILIKE is not 
standard SQL.

 ILIKE does not support escape characters.
 -

 Key: DRILL-3301
 URL: https://issues.apache.org/jira/browse/DRILL-3301
 Project: Apache Drill
  Issue Type: Bug
Reporter: Patrick Toole

 The like operator properly supports escaping characters. Because the ILIKE is 
 implemented as a function, it does not support escaping.
 The grammar needs to be updated to accept ILIKE in the same locations as LIKE.



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


[jira] [Commented] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Deneche A. Hakim (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14588525#comment-14588525
 ] 

Deneche A. Hakim commented on DRILL-3298:
-

[~amansinha100] can you take a look at this plan (when slice_target = 1) is it 
correct ? looks like the sort and window function are applied in parallel on 
the incoming data, if this is the case then the window function will compute 
wrong results:

{noformat}
00-01  Project(c_integer=[$0], EXPR$1=[$1])
00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
01-01  SelectionVectorRemover
01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
01-03  Project(c_integer=[$0], EXPR$1=[$1])
01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
02-01  UnorderedMuxExchange
03-01Project(c_integer=[$0], EXPR$1=[$1], 
E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
CAST($2):ANY, null)])
03-03Window(window#0=[window(partition {} order by [0 
DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
$SUM0($0)])])
03-04  SelectionVectorRemover
03-05Sort(sort0=[$0], dir0=[DESC])
03-06  Scan(groupscan=[ParquetGroupScan 
[entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
columns=[`c_integer`]]])
{noformat}

 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 URL: https://issues.apache.org/jira/browse/DRILL-3298
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Chris Westin
Priority: Critical
  Labels: window_function
 Attachments: j1.tar, test.res


 This query returns incorrect result when planner.slice_target = 1
 {code}
 select
 j1.c_integer,
 sum(j1.c_integer) over w
 from j1
 window  w as (order by c_integer desc)
 order by
 1, 2;
 {code}
 Query plan with planner.slice_target = 1
 {noformat}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
 01-01  SelectionVectorRemover
 01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 01-03  Project(c_integer=[$0], EXPR$1=[$1])
 01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
 02-01  UnorderedMuxExchange
 03-01Project(c_integer=[$0], EXPR$1=[$1], 
 E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
 03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
 CAST($2):ANY, null)])
 03-03Window(window#0=[window(partition {} order by [0 
 DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 03-04  SelectionVectorRemover
 03-05Sort(sort0=[$0], dir0=[DESC])
 03-06  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {noformat}
 Query plan with planner.slice_target = 10;
 {noformat}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SelectionVectorRemover
 00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
 null)])
 00-05  Window(window#0=[window(partition {} order by [0 DESC] 
 range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 00-06SelectionVectorRemover
 00-07  Sort(sort0=[$0], dir0=[DESC])
 00-08Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {noformat}
 Attached:
 * table j1
 * test.res - result generated with postgres



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


[jira] [Assigned] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Deneche A. Hakim (JIRA)

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

Deneche A. Hakim reassigned DRILL-3298:
---

Assignee: Deneche A. Hakim  (was: Chris Westin)

 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 URL: https://issues.apache.org/jira/browse/DRILL-3298
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Deneche A. Hakim
Priority: Critical
  Labels: window_function
 Fix For: 1.1.0

 Attachments: j1.tar, test.res


 This query returns incorrect result when planner.slice_target = 1
 {code}
 select
 j1.c_integer,
 sum(j1.c_integer) over w
 from j1
 window  w as (order by c_integer desc)
 order by
 1, 2;
 {code}
 Query plan with planner.slice_target = 1
 {noformat}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
 01-01  SelectionVectorRemover
 01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 01-03  Project(c_integer=[$0], EXPR$1=[$1])
 01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
 02-01  UnorderedMuxExchange
 03-01Project(c_integer=[$0], EXPR$1=[$1], 
 E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
 03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
 CAST($2):ANY, null)])
 03-03Window(window#0=[window(partition {} order by [0 
 DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 03-04  SelectionVectorRemover
 03-05Sort(sort0=[$0], dir0=[DESC])
 03-06  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {noformat}
 Query plan with planner.slice_target = 10;
 {noformat}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SelectionVectorRemover
 00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
 null)])
 00-05  Window(window#0=[window(partition {} order by [0 DESC] 
 range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 00-06SelectionVectorRemover
 00-07  Sort(sort0=[$0], dir0=[DESC])
 00-08Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {noformat}
 Attached:
 * table j1
 * test.res - result generated with postgres



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


[jira] [Updated] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Deneche A. Hakim (JIRA)

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

Deneche A. Hakim updated DRILL-3298:

Fix Version/s: 1.1.0

 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 URL: https://issues.apache.org/jira/browse/DRILL-3298
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Chris Westin
Priority: Critical
  Labels: window_function
 Fix For: 1.1.0

 Attachments: j1.tar, test.res


 This query returns incorrect result when planner.slice_target = 1
 {code}
 select
 j1.c_integer,
 sum(j1.c_integer) over w
 from j1
 window  w as (order by c_integer desc)
 order by
 1, 2;
 {code}
 Query plan with planner.slice_target = 1
 {noformat}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
 01-01  SelectionVectorRemover
 01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 01-03  Project(c_integer=[$0], EXPR$1=[$1])
 01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
 02-01  UnorderedMuxExchange
 03-01Project(c_integer=[$0], EXPR$1=[$1], 
 E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
 03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
 CAST($2):ANY, null)])
 03-03Window(window#0=[window(partition {} order by [0 
 DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 03-04  SelectionVectorRemover
 03-05Sort(sort0=[$0], dir0=[DESC])
 03-06  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {noformat}
 Query plan with planner.slice_target = 10;
 {noformat}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SelectionVectorRemover
 00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
 null)])
 00-05  Window(window#0=[window(partition {} order by [0 DESC] 
 range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 00-06SelectionVectorRemover
 00-07  Sort(sort0=[$0], dir0=[DESC])
 00-08Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {noformat}
 Attached:
 * table j1
 * test.res - result generated with postgres



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


[jira] [Commented] (DRILL-3204) Problem in name resolution with window functions

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

[ 
https://issues.apache.org/jira/browse/DRILL-3204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14588383#comment-14588383
 ] 

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

https://reviews.apache.org/r/35525/

 Problem in name resolution with window functions
 

 Key: DRILL-3204
 URL: https://issues.apache.org/jira/browse/DRILL-3204
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Sean Hsuan-Yi Chu
Priority: Blocker
  Labels: window_function
 Fix For: 1.1.0


 Trying to use window functions with the join and window aggregate function on 
 one of the columns coming out of join, get an error:
 {code}
 0: jdbc:drill:schema=dfs select sum(t1.a1) over(partition by t1.b1)  from 
 t1, t2 where t1.c1 = t2.c2 group by t1.a1, t1.b1;
 Error: PARSE ERROR: At line 0, column 0: Column 'a1' is ambiguous
 [Error Id: 3a6c4906-c48f-41c7-b9e1-3f59a951e55f on atsqa4-133.qa.lab:31010] 
 (state=,code=0)
 {code}
 Tables used in the query:
 {code}
 0: jdbc:drill:schema=dfs select * from t1 limit 1;
 +-++-+
 | a1  |   b1   | c1  |
 +-++-+
 | 1   | a  | 2015-01-01  |
 +-++-+
 1 row selected (0.133 seconds)
 0: jdbc:drill:schema=dfs select * from t2 limit 1;
 +-+--+-+
 | a2  |  b2  | c2  |
 +-+--+-+
 | 0   | zzz  | 2014-12-31  |
 +-+--+-+
 1 row selected (0.121 seconds)
 {code}



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


[jira] [Updated] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Victoria Markman (JIRA)

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

Victoria Markman updated DRILL-3298:

Attachment: test.res

 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 URL: https://issues.apache.org/jira/browse/DRILL-3298
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Chris Westin
Priority: Critical
  Labels: window_function
 Attachments: j1.tar, test.res


 This query returns incorrect result when planner.slice_target = 1
 {code}
 select
 j1.c_integer,
 sum(j1.c_integer) over w
 from j1
 window  w as (order by c_integer desc)
 order by
 1, 2;
 {code}
 Query plan with planner.slice_target = 1
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
 01-01  SelectionVectorRemover
 01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 01-03  Project(c_integer=[$0], EXPR$1=[$1])
 01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
 02-01  UnorderedMuxExchange
 03-01Project(c_integer=[$0], EXPR$1=[$1], 
 E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
 03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
 CAST($2):ANY, null)])
 03-03Window(window#0=[window(partition {} order by [0 
 DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 03-04  SelectionVectorRemover
 03-05Sort(sort0=[$0], dir0=[DESC])
 03-06  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Query plan with planner.slice_target = 10;
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SelectionVectorRemover
 00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
 null)])
 00-05  Window(window#0=[window(partition {} order by [0 DESC] 
 range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 00-06SelectionVectorRemover
 00-07  Sort(sort0=[$0], dir0=[DESC])
 00-08Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Attached:
 * table j1
 * test.res - result generated with postgres



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


[jira] [Updated] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Victoria Markman (JIRA)

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

Victoria Markman updated DRILL-3298:

Attachment: test.res

 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 URL: https://issues.apache.org/jira/browse/DRILL-3298
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Chris Westin
Priority: Critical
  Labels: window_function
 Attachments: j1.tar, test.res


 This query returns incorrect result when planner.slice_target = 1
 {code}
 select
 j1.c_integer,
 sum(j1.c_integer) over w
 from j1
 window  w as (order by c_integer desc)
 order by
 1, 2;
 {code}
 Query plan with planner.slice_target = 1
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
 01-01  SelectionVectorRemover
 01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 01-03  Project(c_integer=[$0], EXPR$1=[$1])
 01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
 02-01  UnorderedMuxExchange
 03-01Project(c_integer=[$0], EXPR$1=[$1], 
 E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
 03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
 CAST($2):ANY, null)])
 03-03Window(window#0=[window(partition {} order by [0 
 DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 03-04  SelectionVectorRemover
 03-05Sort(sort0=[$0], dir0=[DESC])
 03-06  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Query plan with planner.slice_target = 10;
 {code}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SelectionVectorRemover
 00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
 null)])
 00-05  Window(window#0=[window(partition {} order by [0 DESC] 
 range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 00-06SelectionVectorRemover
 00-07  Sort(sort0=[$0], dir0=[DESC])
 00-08Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {code}
 Attached:
 * table j1
 * test.res - result generated with postgres



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


[jira] [Updated] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Deneche A. Hakim (JIRA)

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

Deneche A. Hakim updated DRILL-3298:

Description: 
This query returns incorrect result when planner.slice_target = 1
{code}
select
j1.c_integer,
sum(j1.c_integer) over w
from j1
window  w as (order by c_integer desc)
order by
1, 2;
{code}

Query plan with planner.slice_target = 1
{noformat}
00-01  Project(c_integer=[$0], EXPR$1=[$1])
00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
01-01  SelectionVectorRemover
01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
01-03  Project(c_integer=[$0], EXPR$1=[$1])
01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
02-01  UnorderedMuxExchange
03-01Project(c_integer=[$0], EXPR$1=[$1], 
E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
CAST($2):ANY, null)])
03-03Window(window#0=[window(partition {} order by [0 
DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
$SUM0($0)])])
03-04  SelectionVectorRemover
03-05Sort(sort0=[$0], dir0=[DESC])
03-06  Scan(groupscan=[ParquetGroupScan 
[entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
columns=[`c_integer`]]])
{noformat}

Query plan with planner.slice_target = 10;
{noformat}
00-01  Project(c_integer=[$0], EXPR$1=[$1])
00-02SelectionVectorRemover
00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
null)])
00-05  Window(window#0=[window(partition {} order by [0 DESC] range 
between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), $SUM0($0)])])
00-06SelectionVectorRemover
00-07  Sort(sort0=[$0], dir0=[DESC])
00-08Scan(groupscan=[ParquetGroupScan 
[entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
columns=[`c_integer`]]])
{noformat}

Attached:
* table j1
* test.res - result generated with postgres

  was:
This query returns incorrect result when planner.slice_target = 1
{code}
select
j1.c_integer,
sum(j1.c_integer) over w
from j1
window  w as (order by c_integer desc)
order by
1, 2;
{code}

Query plan with planner.slice_target = 1
{code}
00-01  Project(c_integer=[$0], EXPR$1=[$1])
00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
01-01  SelectionVectorRemover
01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
01-03  Project(c_integer=[$0], EXPR$1=[$1])
01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
02-01  UnorderedMuxExchange
03-01Project(c_integer=[$0], EXPR$1=[$1], 
E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
CAST($2):ANY, null)])
03-03Window(window#0=[window(partition {} order by [0 
DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
$SUM0($0)])])
03-04  SelectionVectorRemover
03-05Sort(sort0=[$0], dir0=[DESC])
03-06  Scan(groupscan=[ParquetGroupScan 
[entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
columns=[`c_integer`]]])
{code}

Query plan with planner.slice_target = 10;
{code}
00-01  Project(c_integer=[$0], EXPR$1=[$1])
00-02SelectionVectorRemover
00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
null)])
00-05  Window(window#0=[window(partition {} order by [0 DESC] range 
between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), $SUM0($0)])])
00-06SelectionVectorRemover
00-07  Sort(sort0=[$0], dir0=[DESC])
00-08Scan(groupscan=[ParquetGroupScan 
[entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
columns=[`c_integer`]]])
{code}

Attached:
* table j1
* test.res - result generated with postgres


 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 

[jira] [Updated] (DRILL-2604) Make sure implicit casting rules are the same across drill

2015-06-16 Thread Daniel Barclay (Drill) (JIRA)

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

Daniel Barclay (Drill) updated DRILL-2604:
--
Description: 
This is an enhancement request to standardize rules of implicit cast.
It would be nice if rules in joins, set operations and functions where the same.

Number of inconcistencies have been found and reported under:

DRILL-2549 - Implicit Cast between integer and varchar columns in a join should 
work
DRILL-2433 - Implicit cast between date and timestamp is missing in joins

We agreed that this is not 1.0 item and above mentioned bugs will not be 
resolved by GA.

  was:
This is an enhancement request to standartize rules of implicit cast.
It would be nice if rules in joins, set operations and functions where the same.

Number of inconistencies have been found and reported under:

DRILL-2549 - Implicit Cast between integer and varchar columns in a join should 
work
DRILL-2433 - Implicit cast between date and timestamp is missing in joins

We agreed that this is not 1.0 item and above mentioned bugs will not be 
resolved by GA


 Make sure implicit casting rules are the same across drill
 --

 Key: DRILL-2604
 URL: https://issues.apache.org/jira/browse/DRILL-2604
 Project: Apache Drill
  Issue Type: Improvement
  Components: Execution - Data Types
Affects Versions: 0.8.0
Reporter: Victoria Markman
Assignee: Daniel Barclay (Drill)
 Fix For: 1.1.0


 This is an enhancement request to standardize rules of implicit cast.
 It would be nice if rules in joins, set operations and functions where the 
 same.
 Number of inconcistencies have been found and reported under:
 DRILL-2549 - Implicit Cast between integer and varchar columns in a join 
 should work
 DRILL-2433 - Implicit cast between date and timestamp is missing in joins
 We agreed that this is not 1.0 item and above mentioned bugs will not be 
 resolved by GA.



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


[jira] [Commented] (DRILL-3296) Group By Union Distinct fails at planning

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

[ 
https://issues.apache.org/jira/browse/DRILL-3296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14588384#comment-14588384
 ] 

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

https://reviews.apache.org/r/35525/

 Group By Union Distinct fails at planning
 -

 Key: DRILL-3296
 URL: https://issues.apache.org/jira/browse/DRILL-3296
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Reporter: Sean Hsuan-Yi Chu
Assignee: Sean Hsuan-Yi Chu

 For example,
 select n_nationkey from
 (select n_nationkey from cp.`tpch/nation.parquet`
 union select n_nationkey from cp.`tpch/nation.parquet`)
 group by n_nationkey
 Will fail. Actually, this issue was already resolved in Calcite-675. After 
 picking this commit, this issue will go away.



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


[jira] [Updated] (DRILL-2915) Regression: Mondrian query5614.q - Query failed: SYSTEM ERROR: This query cannot be planned possibly due to either a cartesian join or an inequality join

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-2915:
--
Fix Version/s: (was: 1.1.0)
   1.2.0

 Regression: Mondrian query5614.q - Query failed: SYSTEM ERROR: This query 
 cannot be planned possibly due to either a cartesian join or an inequality 
 join
 -

 Key: DRILL-2915
 URL: https://issues.apache.org/jira/browse/DRILL-2915
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Affects Versions: 0.9.0
Reporter: Chun Chang
Assignee: Aman Sinha
Priority: Critical
 Fix For: 1.2.0

 Attachments: mondrian_query5614.explain


 #Wed Apr 29 14:39:22 EDT 2015
 git.commit.id.abbrev=f5b0f49
 The following mondrian query fails now.
 {code}
 SELECT store.store_state   AS c0, 
Count(DISTINCT sales_fact_1997.customer_id) AS m0 
 FROM   store AS store, 
sales_fact_1997 AS sales_fact_1997, 
time_by_day AS time_by_day, 
product_class AS product_class, 
product AS product 
 WHERE  sales_fact_1997.store_id = store.store_id 
AND store.store_state = 'CA' 
AND sales_fact_1997.time_id = time_by_day.time_id 
AND sales_fact_1997.product_id = product.product_id 
AND product.product_class_id = product_class.product_class_id 
AND ( ( product_class.product_family = 'Food' 
AND time_by_day.quarter = 'Q1' 
AND time_by_day.the_year = 1997 ) 
   OR ( product_class.product_family = 'Drink' 
AND time_by_day.month_of_year = 4 
AND time_by_day.quarter = 'Q2' 
AND time_by_day.the_year = 1997 ) ) 
 GROUP  BY store.store_state; 
 {code}
 postgres:
 {code}
 foodmart=# select store.store_state as c0, count(distinct 
 sales_fact_1997.customer_id) as m0 from store as store, sales_fact_1997 as 
 sales_fact_1997, time_by_day as time_by_day, product_class as product_class, 
 product as product where sales_fact_1997.store_id = store.store_id and 
 store.store_state = 'CA' and sales_fact_1997.time_id = time_by_day.time_id 
 and sales_fact_1997.product_id = product.product_id and 
 product.product_class_id = product_class.product_class_id and 
 ((product_class.product_family = 'Food' and time_by_day.quarter = 'Q1' and 
 time_by_day.the_year = 1997) or (product_class.product_family = 'Drink' and 
 time_by_day.month_of_year = 4 and time_by_day.quarter = 'Q2' and 
 time_by_day.the_year = 1997)) group by store.store_state;
  c0 |  m0
 +--
  CA | 1175
 (1 row)
 {code}
 drill failed
 {code}
 0: jdbc:drill:schema=dfs.drillTestDirAdvanced select store.store_state as 
 c0, count(distinct sales_fact_1997.customer_id) as m0 from store as store, 
 sales_fact_1997 as sales_fact_1997, time_by_day as time_by_day, product_class 
 as product_class, product as product where sales_fact_1997.store_id = 
 store.store_id and store.store_state = 'CA' and sales_fact_1997.time_id = 
 time_by_day.time_id and sales_fact_1997.product_id = product.product_id and 
 product.product_class_id = product_class.product_class_id and 
 ((product_class.product_family = 'Food' and time_by_day.quarter = 'Q1' and 
 time_by_day.the_year = 1997) or (product_class.product_family = 'Drink' and 
 time_by_day.month_of_year = 4 and time_by_day.quarter = 'Q2' and 
 time_by_day.the_year = 1997)) group by store.store_state;
 Query failed: SYSTEM ERROR: This query cannot be planned possibly due to 
 either a cartesian join or an inequality join
 [3eb99963-92aa-4129-844f-fe43839537b9 on qa-node119.qa.lab:31010]
 Error: exception while executing query: Failure while executing query. 
 (state=,code=0)
 {code}



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


[jira] [Updated] (DRILL-2999) Parse-error exception logged to stdout/stderr (visible in SQLLine output)

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-2999:
--
Fix Version/s: 1.2.0

 Parse-error exception logged to stdout/stderr (visible in SQLLine output)
 -

 Key: DRILL-2999
 URL: https://issues.apache.org/jira/browse/DRILL-2999
 Project: Apache Drill
  Issue Type: Bug
  Components: SQL Parser
Reporter: Daniel Barclay (Drill)
 Fix For: 1.2.0


 For some Calcite/parsing exceptions that seem to be internal (seem to be 
 caught and processed (translated) at a higher level), Calcite or parsing 
 logging is writing SEVERE-level logging messages to stdout or stderr.  
 When SQLLine runs Drill in embedded mode, those logging lines show up 
 intermixed in the SQLLine output
 {noformat}
 0: jdbc:drill:zk=local bad syntax;
 May 08, 2015 2:42:23 PM org.apache.calcite.runtime.CalciteException init
 SEVERE: org.apache.calcite.runtime.CalciteException: Non-query expression 
 encountered in illegal context
 May 08, 2015 2:42:23 PM org.apache.calcite.runtime.CalciteException init
 SEVERE: org.apache.calcite.runtime.CalciteContextException: From line 1, 
 column 1 to line 1, column 3: Non-query expression encountered in illegal 
 context
 Error: SYSTEM ERROR: Failure parsing SQL. Non-query expression encountered in 
 illegal context
 [Error Id: 87c20db6-58b1-4042-9060-42ee29945377 on dev-linux2:31016] 
 (state=,code=0)
 0: jdbc:drill:zk=local 
 {noformat}
 (The Error: SYSTEM ... lines are the normal error from SQLLine including 
 exception message text from Drill.  The four lines starting with May or 
 SEVERE are the extraneous logging output.)



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


[jira] [Resolved] (DRILL-2988) Correlated exists subquery returns wrong result if join columns in subquery are not fully qualified

2015-06-16 Thread Victoria Markman (JIRA)

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

Victoria Markman resolved DRILL-2988.
-
Resolution: Won't Fix

This works as by  design currently.

 Correlated exists subquery returns wrong result if join columns in subquery 
 are not fully qualified
 ---

 Key: DRILL-2988
 URL: https://issues.apache.org/jira/browse/DRILL-2988
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Jinfeng Ni
  Labels: document_if_not_fixed

 Two parquet tables:
 {code}
 0: jdbc:drill:schema=dfs select * from t1;
 ++++
 | a1 | b1 | c1 |
 ++++
 | 1  | a  | 2015-01-01 |
 | 2  | b  | 2015-01-02 |
 | 3  | c  | 2015-01-03 |
 | 4  | null   | 2015-01-04 |
 | 5  | e  | 2015-01-05 |
 | 6  | f  | 2015-01-06 |
 | 7  | g  | 2015-01-07 |
 | null   | h  | 2015-01-08 |
 | 9  | i  | null   |
 | 10 | j  | 2015-01-10 |
 ++++
 10 rows selected (0.109 seconds)
 0: jdbc:drill:schema=dfs select * from t3;
 ++++
 | a3 | b3 | c3 |
 ++++
 | 1  | a  | 2015-01-01 |
 | 2  | b  | 2015-01-02 |
 | 3  | c  | 2015-01-03 |
 ++++
 3 rows selected (0.106 seconds)
 {code}
 When column name is not qualified with the table name in the join condition, 
 we get wrong result:
 {code}
 0: jdbc:drill:schema=dfs select * from t1 where exists (select * from t3 
 where a1 = a3);
 ++++
 | a1 | b1 | c1 |
 ++++
 | 1  | a  | 2015-01-01 |
 | 2  | b  | 2015-01-02 |
 | 3  | c  | 2015-01-03 |
 | 4  | null   | 2015-01-04 |
 | 5  | e  | 2015-01-05 |
 | 6  | f  | 2015-01-06 |
 | 7  | g  | 2015-01-07 |
 | null   | h  | 2015-01-08 |
 | 9  | i  | null   |
 | 10 | j  | 2015-01-10 |
 ++++
 10 rows selected (0.177 seconds)
 {code}
 Works correctly when column names are fully qualified ...
 {code}
 0: jdbc:drill:schema=dfs select * from t1 where exists (select * from t3 
 where t1.a1 = t3.a3);
 ++++
 | a1 | b1 | c1 |
 ++++
 | 1  | a  | 2015-01-01 |
 | 2  | b  | 2015-01-02 |
 | 3  | c  | 2015-01-03 |
 ++++
 3 rows selected (0.353 seconds)
 {code}
 Plan for the query with the wrong result:
 {code}
 0: jdbc:drill:schema=dfs explain plan for select * from t1 where exists 
 (select * from t3 where a1 = a3);
 +++
 |text|json|
 +++
 | 00-00Screen
 00-01  Project(*=[$0])
 00-02Project(T124¦¦*=[$0])
 00-03  NestedLoopJoin(condition=[true], joinType=[inner])
 00-05Project(T124¦¦*=[$0])
 00-07  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:/drill/testdata/aggregation/t1]], 
 selectionRoot=/drill/testdata/aggregation/t1, numFiles=1, columns=[`*`]]])
 00-04SelectionVectorRemover
 00-06  Filter(condition=[IS NOT NULL($0)])
 00-08StreamAgg(group=[{}], agg#0=[MIN($0)])
 00-09  Project($f0=[true])
 00-10SelectionVectorRemover
 00-11  Filter(condition=[=($0, $1)])
 00-12Project(a1=[$1], a3=[$0])
 00-13  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:/drill/testdata/aggregation/t3]], 
 selectionRoot=/drill/testdata/aggregation/t3, numFiles=1, columns=[`a1`, 
 `a3`]]])
 {code}



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


[jira] [Updated] (DRILL-3238) Cannot Plan Exception is raised when the same window partition is defined in select window clauses

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-3238:
--
Fix Version/s: Future

 Cannot Plan Exception is raised when the same window partition is defined in 
 select  window clauses
 

 Key: DRILL-3238
 URL: https://issues.apache.org/jira/browse/DRILL-3238
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Reporter: Sean Hsuan-Yi Chu
Assignee: Sean Hsuan-Yi Chu
  Labels: window_function
 Fix For: Future


 While this works:
 {code}
 select sum(a2) over(partition by a2 order by a2), count(*) over(partition by 
 a2 order by a2) 
 from t
 {code}
 , this fails
 {code}
 select sum(a2) over(w), count(*) over(partition by a2 order by a2) 
 from t
 window w as (partition by a2 order by a2)
 {code}
 Notice these two queries are logically the same thing if we plug-in the 
 window definition back into the SELECT-CLAUSE in the 2nd query.



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


[jira] [Updated] (DRILL-3212) Passing star as an argument to any drill function results in NPE

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-3212:
--
Fix Version/s: Future

 Passing star as an argument to any drill function results in NPE
 

 Key: DRILL-3212
 URL: https://issues.apache.org/jira/browse/DRILL-3212
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Jinfeng Ni
Priority: Minor
 Fix For: Future


 I made a mistake and typed '*' in a SUM function and got NPE:
 {code}
 0: jdbc:drill:schema=dfs select sum(*) from t1;
 Error: SYSTEM ERROR: java.lang.IndexOutOfBoundsException: index (0) must be 
 less than size (0)
 [Error Id: 95baf256-8eed-426b-a2e2-5c4652c85bc8 on atsqa4-133.qa.lab:31010] 
 (state=,code=0)
 0: jdbc:drill:schema=dfs select avg(*) from t1;
 Error: SYSTEM ERROR: java.lang.IndexOutOfBoundsException: index (0) must be 
 less than size (0)
 [Error Id: 771b2b36-6a4f-4a1d-9b01-b2fd6947ffb2 on atsqa4-133.qa.lab:31010] 
 (state=,code=0)
 {code}
 Try it with any other function, it will fail in exactly same way.



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


[jira] [Updated] (DRILL-745) Drill fails to read the schema of avro tables from hive when the schema is in a separate file

2015-06-16 Thread Venki Korukanti (JIRA)

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

Venki Korukanti updated DRILL-745:
--
Attachment: DRILL-745-1.patch

Doesn't repro anymore. Adding a test.

 Drill fails to read the schema of avro tables from hive when the schema is in 
 a separate file
 -

 Key: DRILL-745
 URL: https://issues.apache.org/jira/browse/DRILL-745
 Project: Apache Drill
  Issue Type: Improvement
  Components: Storage - Hive
Reporter: Rahul Challapalli
Assignee: Venki Korukanti
 Fix For: 1.1.0

 Attachments: DRILL-745-1.patch


 Follow the below steps to reproduce the issue :
 1. hadoop fs -copyFromLocal doctors.avsc /drill/
 2. run the hive queries from doctors.ddl
 3. From drill, the describe command fails to get the schema for 
 doctors_fileschema table. It gives the below information :
 0: jdbc:drill:schema=dfs describe doctors_fileschema;
 +-++-+
 | COLUMN_NAME | DATA_TYPE  | IS_NULLABLE |
 +-++-+
 | error_error_error_error_error_error_error | VARCHAR| NO  |
 | cannot_determine_schema | VARCHAR| NO  |
 | check   | VARCHAR| NO  |
 | schema  | VARCHAR| NO  |
 | url | VARCHAR| NO  |
 | and | VARCHAR| NO  |
 | literal | VARCHAR| NO  |
 +-++-+



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


[jira] [Updated] (DRILL-2732) Different logical plan based on field names

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-2732:
--
Fix Version/s: (was: 1.1.0)
   1.2.0

 Different logical plan based on field names
 ---

 Key: DRILL-2732
 URL: https://issues.apache.org/jira/browse/DRILL-2732
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Affects Versions: 0.8.0
Reporter: Adam Gilmore
Assignee: Jinfeng Ni
 Fix For: 1.2.0


 The following two queries produce different logical plans:
 {code}
 select count(*) from cp.`employee.json` where mytestFieldNum = 4 and 
 myOtherLongIdString = '12345'
 {code}
 {code}
 select count(*) from cp.`employee.json` where my_testFieldNum = 4 and 
 my_OtherLongIdString = '12345'
 {code}
 The latter adds a project step to the logical plan.  The ramifications of 
 this means that, for example, the Mongo storage provider will not push down 
 filters because it's matching on a scan/filter.
 It has nothing to do with the underscore - in fact, it seems if you 
 substitute the underscore with a variety of characters, it produces different 
 results.
 It also seems to not be reliant on the length of the field names in question.
 These two queries should really produce identical logical plans.



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


[jira] [Updated] (DRILL-3266) Drill's hive storage plugin cannot find RegexSerDe

2015-06-16 Thread Venki Korukanti (JIRA)

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

Venki Korukanti updated DRILL-3266:
---
Attachment: DRILL-3266-1.patch

 Drill's hive storage plugin cannot find RegexSerDe
 --

 Key: DRILL-3266
 URL: https://issues.apache.org/jira/browse/DRILL-3266
 Project: Apache Drill
  Issue Type: Bug
  Components: Storage - Hive
Reporter: Rahul Challapalli
Assignee: Venki Korukanti
 Attachments: DRILL-3266-1.patch, apache_log.txt, error.log


 git.commit.id.abbrev=5f26b8b
 HIve DDL :
 {code}
 CREATE EXTERNAL TABLE IF NOT EXISTS hive_storage.raw_access_log(
 remote_host STRING,
 remote_logname STRING,
 remote_user STRING,
 request_time STRING,
 first_line STRING,
 http_status STRING,
 bytes STRING
 )
 ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
 WITH SERDEPROPERTIES (
 input.regex = ([^ ]*) ([^ ]*) ([^ ]*) (-|\\[[^\\]]*\\]) ([^ 
 \]*|\[^\]*\) (-|[0-9]*) (-|[0-9]*),
 output.format.string = %1$s %2$s %3$s %4$s %5$s %6$s %7$s
 )
 LOCATION '/drill/testdata/hive_storage/raw_access_log';
 {code}
 When I try to query this table from sqlline, I get the below error
 {code}
 0: jdbc:drill:schema=dfs_eea select * from raw_access_log;
 Error: PARSE ERROR: MetaException(message:java.lang.ClassNotFoundException 
 Class org.apache.hadoop.hive.contrib.serde2.RegexSerDe not found)
 [Error Id: 5961c4c4-1cf5-495c-9c8a-0616b58d2488 on qa-node190.qa.lab:31010] 
 (state=,code=0)
 {code}
 The query works from hive without any issues. I attached the data set and the 
 error log



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


[jira] [Updated] (DRILL-3292) SUM(constant) OVER(...) returns wrong results

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-3292:
--
Fix Version/s: 1.1.0

 SUM(constant) OVER(...) returns wrong results
 -

 Key: DRILL-3292
 URL: https://issues.apache.org/jira/browse/DRILL-3292
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Relational Operators, Query Planning  
 Optimization
Affects Versions: 1.0.0
Reporter: Deneche A. Hakim
Assignee: Deneche A. Hakim
 Fix For: 1.1.0


 The following query returns wrong results:
 {noformat}
 0: jdbc:drill: select sum(1) over w sum1, sum(5) over w sum5 from 
 cp.`employee.json` where position_id = 2 window w as (partition by 
 position_id);
 +---+---+
 | sum1  | sum5  |
 +---+---+
 | 6 | 6 |
 | 6 | 6 |
 | 6 | 6 |
 | 6 | 6 |
 | 6 | 6 |
 | 6 | 6 |
 +---+---+
 {noformat}
 The second column should display 30 (5 x 6) instead of 6.
 Here is the plan for the query:
 {noformat}
 00-00Screen
 00-01  Project(sum1=[$0], sum5=[$1])
 00-02Project(sum1=[$0], sum5=[$1])
 00-03  Project($0=[$1], $1=[$2])
 00-04Window(window#0=[window(partition {0} order by [] range 
 between UNBOUNDED PRECEDING and UNBOUNDED FOLLOWING aggs [SUM($1), SUM($2)])])
 00-05  SelectionVectorRemover
 00-06Sort(sort0=[$0], dir0=[ASC])
 00-07  Filter(condition=[=($0, 2)])
 00-08Scan(groupscan=[EasyGroupScan 
 [selectionRoot=/employee.json, numFiles=1, columns=[`position_id`], 
 files=[classpath:/employee.json]]])
 {noformat}



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


[jira] [Updated] (DRILL-2990) Use of limit and offset together results in calcite.tools.ValidationException: java.lang.UnsupportedOperationException

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-2990:
--
Fix Version/s: Future

 Use of limit and offset together results in 
 calcite.tools.ValidationException: java.lang.UnsupportedOperationException
 --

 Key: DRILL-2990
 URL: https://issues.apache.org/jira/browse/DRILL-2990
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Affects Versions: 1.0.0
 Environment: b856d0dd50a4495f95ee5d32ea3d396df56842ed
Reporter: Khurram Faraaz
Assignee: Jinfeng Ni
 Fix For: Future


 Use of limit and offset leads to 
 calcite.tools.ValidationException: UnsupportedOperationException
 Tested on 4 node cluster on CentOS.
  
 {code}
 0: jdbc:drill: (select * from `airports.csv` offset 1) limit 10;
 Error: PARSE ERROR: java.lang.UnsupportedOperationException
 [Error Id: 4e5f8f9d-6115-4b73-a872-4c3c06d2ba00 on centos-01.qa.lab:31010] 
 (state=,code=0)
 {code}
 {code}0: jdbc:drill: (select * from `airports.csv` limit 10) offset 1;
 Error: PARSE ERROR: java.lang.UnsupportedOperationException
 [Error Id: 841d55f0-4131-488a-a1cf-c8575e2a2c21 on centos-01.qa.lab:31010] 
 (state=,code=0)
 {code}
 case where there are two set of parenthesis 
 {code}
 0: jdbc:drill: ((select * from `airports.csv` offset 1) limit 10);
 Error: PARSE ERROR: java.lang.UnsupportedOperationException
 [Error Id: 5bbb1dd1-54c4-44bd-982c-6c63974da7c4 on centos-01.qa.lab:31010] 
 (state=,code=0)
 {code}
 {code}
 0: jdbc:drill: ((select * from `airports.csv` limit 10) offset 1);
 Error: PARSE ERROR: java.lang.UnsupportedOperationException
 [Error Id: 55acf905-f26d-46bc-bf93-b3048ef0fccd on centos-01.qa.lab:31010] 
 (state=,code=0)
 {code}
 Total number of records in airports.cv
 {code}
 0: jdbc:drill: select count(*) from `airports.csv`;
 ++
 |   EXPR$0   |
 ++
 | 46315  |
 ++
 1 row selected (0.294 seconds)
 {code}
 Stack trace from drillbit.log
 {code}
 org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception 
 during fragment initialization: PARSE ERROR: 
 java.lang.UnsupportedOperationException
 [Error Id: d3bd80ce-786c-488a-94e9-97073c3edcbb ]
 at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:212) 
 [drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  [na:1.7.0_75]
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  [na:1.7.0_75]
 at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]
 Caused by: org.apache.drill.common.exceptions.UserException: PARSE ERROR: 
 java.lang.UnsupportedOperationException
 [Error Id: d3bd80ce-786c-488a-94e9-97073c3edcbb ]
 at 
 org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:465)
  ~[drill-common-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:170)
  ~[drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:788) 
 [drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:203) 
 [drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 ... 3 common frames omitted
 Caused by: org.apache.calcite.tools.ValidationException: 
 java.lang.UnsupportedOperationException
 at 
 org.apache.calcite.prepare.PlannerImpl.validate(PlannerImpl.java:176) 
 ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at 
 org.apache.calcite.prepare.PlannerImpl.validateAndGetType(PlannerImpl.java:185)
  ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at 
 org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateNode(DefaultSqlHandler.java:191)
  ~[drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:143)
  ~[drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:167)
  ~[drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 ... 5 common frames omitted
 Caused by: java.lang.UnsupportedOperationException: null
 at org.apache.calcite.sql.SqlCall.setOperand(SqlCall.java:63) 
 ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at 
 org.apache.calcite.sql.validate.SqlValidatorImpl.performUnconditionalRewrites(SqlValidatorImpl.java:1004)
  

[jira] [Updated] (DRILL-3280) Missing OVER clause in window function query results in AssertionError

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-3280:
--
Fix Version/s: 1.2.0

 Missing OVER clause in window function query results in AssertionError
 --

 Key: DRILL-3280
 URL: https://issues.apache.org/jira/browse/DRILL-3280
 Project: Apache Drill
  Issue Type: Bug
  Components: SQL Parser
Affects Versions: 1.0.0
Reporter: Khurram Faraaz
Assignee: Sean Hsuan-Yi Chu
 Fix For: 1.2.0


 Missing OVER clause results in AssertionError.
 Instead, we will need an error message that said, window function call 
 requires an OVER clause
 {code}
 0: jdbc:drill:schema=dfs.tmp select rank(), cume_dist() over w from 
 `allDataInPrq/0_0_0.parquet` window w as (partition by col_chr order by 
 col_dbl);
 Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
 Unexpected exception during fragment initialization: null
 [Error Id: f8675256-eea9-4ca6-859c-4c0b714f27a0 on centos-02.qa.lab:31010] 
 (state=,code=0)
 {code}
 Stack trace from drillbit.log
 {code}
 2015-06-11 20:50:42,054 [2a860b5d-dd87-087f-3730-bf47a10f5d97:foreman] ERROR 
 o.a.d.c.exceptions.UserException - SYSTEM ERROR: 
 org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception 
 during fragment initialization: null
 [Error Id: f8675256-eea9-4ca6-859c-4c0b714f27a0 on centos-02.qa.lab:31010]
 org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: 
 org.apache.drill.exec.work.foreman.ForemanException: Unexpected exception 
 during fragment initialization: null
 [Error Id: f8675256-eea9-4ca6-859c-4c0b714f27a0 on centos-02.qa.lab:31010]
 at 
 org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:522)
  ~[drill-common-1.1.0-SNAPSHOT-rebuffed.jar:1.1.0-SNAPSHOT]
 at 
 org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:738)
  [drill-java-exec-1.1.0-SNAPSHOT-rebuffed.jar:1.1.0-SNAPSHOT]
 at 
 org.apache.drill.exec.work.foreman.Foreman$StateSwitch.processEvent(Foreman.java:840)
  [drill-java-exec-1.1.0-SNAPSHOT-rebuffed.jar:1.1.0-SNAPSHOT]
 at 
 org.apache.drill.exec.work.foreman.Foreman$StateSwitch.processEvent(Foreman.java:782)
  [drill-java-exec-1.1.0-SNAPSHOT-rebuffed.jar:1.1.0-SNAPSHOT]
 at 
 org.apache.drill.common.EventProcessor.sendEvent(EventProcessor.java:73) 
 [drill-common-1.1.0-SNAPSHOT-rebuffed.jar:1.1.0-SNAPSHOT]
 at 
 org.apache.drill.exec.work.foreman.Foreman$StateSwitch.moveToState(Foreman.java:784)
  [drill-java-exec-1.1.0-SNAPSHOT-rebuffed.jar:1.1.0-SNAPSHOT]
 at 
 org.apache.drill.exec.work.foreman.Foreman.moveToState(Foreman.java:893) 
 [drill-java-exec-1.1.0-SNAPSHOT-rebuffed.jar:1.1.0-SNAPSHOT]
 at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:253) 
 [drill-java-exec-1.1.0-SNAPSHOT-rebuffed.jar:1.1.0-SNAPSHOT]
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  [na:1.7.0_45]
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  [na:1.7.0_45]
 at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
 Caused by: org.apache.drill.exec.work.foreman.ForemanException: Unexpected 
 exception during fragment initialization: null
 ... 4 common frames omitted
 Caused by: java.lang.AssertionError: null
 at 
 org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.getRootField(SqlToRelConverter.java:3810)
  ~[calcite-core-1.1.0-drill-r7.jar:1.1.0-drill-r7]
 at 
 org.apache.calcite.sql2rel.SqlToRelConverter.adjustInputRef(SqlToRelConverter.java:3139)
  ~[calcite-core-1.1.0-drill-r7.jar:1.1.0-drill-r7]
 at 
 org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:3114)
  ~[calcite-core-1.1.0-drill-r7.jar:1.1.0-drill-r7]
 at 
 org.apache.calcite.sql2rel.SqlToRelConverter.access$1400(SqlToRelConverter.java:180)
  ~[calcite-core-1.1.0-drill-r7.jar:1.1.0-drill-r7]
 at 
 org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4061)
  ~[calcite-core-1.1.0-drill-r7.jar:1.1.0-drill-r7]
 at 
 org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:3489)
  ~[calcite-core-1.1.0-drill-r7.jar:1.1.0-drill-r7]
 at 
 org.apache.calcite.sql.SqlIdentifier.accept(SqlIdentifier.java:274) 
 ~[calcite-core-1.1.0-drill-r7.jar:1.1.0-drill-r7]
 at 
 org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:3944)
  ~[calcite-core-1.1.0-drill-r7.jar:1.1.0-drill-r7]
 at 
 org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertSortExpression(SqlToRelConverter.java:3962)
  

[jira] [Updated] (DRILL-1441) Replace sql function requires backticks to avoid parse error

2015-06-16 Thread Jinfeng Ni (JIRA)

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

Jinfeng Ni updated DRILL-1441:
--
Fix Version/s: (was: 1.1.0)
   Future

 Replace sql function requires backticks to avoid parse error
 

 Key: DRILL-1441
 URL: https://issues.apache.org/jira/browse/DRILL-1441
 Project: Apache Drill
  Issue Type: Bug
  Components: SQL Parser
Reporter: Krystal
Assignee: Jinfeng Ni
Priority: Minor
 Fix For: Future


 git.commit.id.abbrev=f8d38b6
 Currently the replace function requires to be enclosed within backticks 
 (ie. `replace`); otherwise it would fail during the parsing.
 For example the following query fails:
 0: jdbc:drill:schema=M7 select replace(substring(name,1,10), 'or', 'EA') 
 from `dfs.default`.voter where name like 'victor%';
 Query failed: Failure while parsing sql. Encountered replace at line 1, 
 column 8.
 Was expecting one of:
 UNION ...
 INTERSECT ...
 EXCEPT ...
 .
 .
 .
 The following modified query succeeds:
 0: jdbc:drill:schema=M7 select `replace`(substring(name,1,10), 'or', 'EA') 
 from `dfs.default`.voter where name like 'victor%';
 ++
 |   EXPR$0   |
 ++
 | victEA tho |
 | victEA you |
 | victEA rob |
 | victEA van |
 | victEA rob |
 .
 .
 .
 The parse error was originally filed in this jira: 
 https://issues.apache.org/jira/browse/DRILL-738.  We should find a way to 
 avoid requiring backticks as this is a standard sql function.



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


[jira] [Updated] (DRILL-2929) Join query does not return results/error/exception, appears to be hung

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-2929:
--
Fix Version/s: (was: 1.1.0)
   1.2.0

 Join query does not return results/error/exception, appears to be hung
 --

 Key: DRILL-2929
 URL: https://issues.apache.org/jira/browse/DRILL-2929
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Affects Versions: 0.9.0
 Environment: f5b0f4928d9c8c47c145a179c52ba3933d85c0b4 | DRILL-1502: 
 Can't connect to mongo when requiring auth | 29.04.2015 @ 11:22:41 EDT | 
 Unknown | 29.04.2015 @ 14:44:10 EDT |
Reporter: Khurram Faraaz
Assignee: Sean Hsuan-Yi Chu
 Fix For: 1.2.0


 multi way equi join query hangs on rpm version based on 29th. Explain plan 
 does not return anything, web UI shows query as PENDING state. Test was run 
 on 4 node cluster on CentOS. There are no errors/exceptions reported in 
 drillbit.log
 Hanging query is,
 {code}
 0: jdbc:drill: select bi.columns[0], ci.columns[0], di.columns[0], 
 fi.columns[0], ini.columns[0], vi.columns[0]
 . . . . . . .  from `bgint_f.csv` bi,
 . . . . . . .  `char_f.csv` ci,
 . . . . . . .  `dbl_f.csv` di,
 . . . . . . .  `float_f.csv` fi,
 . . . . . . .  `int_f.csv` ini,
 . . . . . . .  `vchar_f.csv` vi
 . . . . . . .  where bi.columns[0] = ci.columns[0]
 . . . . . . .  and di.columns[0] = fi.columns[0]
 . . . . . . .  and ini.columns[0] = vi.columns[0]
 . . . . . . .  and ci.columns[0] = di.columns[0]
 . . . . . . .  and fi.columns[0] = ini.columns[0]
 . . . . . . .  and ci.columns[0] = ini.columns[0];
 {code}
 Data used in test is
 {code}
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/bgint_f.csv
 1
 2
 0
 -1
 100
 65535
 100
 13
 19
 17
 11
 1010101
 999
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/char_f.csv
 1
 2
 3
 4
 5
 6
 7
 8
 9
 0
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/dbl_f.csv
 123.45
 11.98
 12345.39
 1.1
 1.0
 0.0
 -1.0
 1.99
 9.99
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/float_f.csv
 1.1
 1.234
 1234.19
 13.19
 1.0
 -1.0
 0.0
 .98
 .99
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/int_f.csv
 1
 0
 -1
 65535
 1234567
 100
 101010
 1
 100
 13
 19
 17
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/vchar_f.csv
 12345
 1
 0
 -1
 20
 100
 65535
 13
 19
 17
 1
 10101
 {code}



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


[jira] [Updated] (DRILL-3002) Can't plan inequality queries when scalar subquery has an expression with at least one distinct aggregate

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-3002:
--
Fix Version/s: (was: 1.1.0)
   1.2.0

 Can't plan inequality queries when scalar subquery has an expression with at 
 least one distinct aggregate
 -

 Key: DRILL-3002
 URL: https://issues.apache.org/jira/browse/DRILL-3002
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Aman Sinha
 Fix For: 1.2.0


 Fails with mix of of distinct/non distinct scalar aggregates on the same 
 column:
 {code}
 0: jdbc:drill:schema=dfs select * from t1 where a1  ( select count(a2) + 
 count(distinct a2) from t2);
 Error: SYSTEM ERROR: This query cannot be planned possibly due to either a 
 cartesian join or an inequality join
 [Error Id: 69c0feda-6284-4a76-b1f7-bbc43a099a20 on atsqa4-133.qa.lab:31010] 
 (state=,code=0)
 {code}
 Works with two distinct aggregates in expression:
 {code}
 0: jdbc:drill:schema=dfs select * from t1 where a1  ( select count(distinct 
 a2) + count(distinct a2) from t2);
 ++++
 | a1 | b1 | c1 |
 ++++
 ++++
 No rows selected (0.226 seconds)
 {code}
 Fails with two distinct aggregates on different columns:
 {code}
 0: jdbc:drill:schema=dfs select * from t1 where a1  ( select count(distinct 
 a2) + count(distinct b2) from t2);
 Error: SYSTEM ERROR: This query cannot be planned possibly due to either a 
 cartesian join or an inequality join
 [Error Id: 80b10ec8-add6-45fd-8f1a-1e68852936a2 on atsqa4-133.qa.lab:31010] 
 (state=,code=0)
 0: jdbc:drill:schema=dfs 
 {code}
 Works with two non distinct scalar aggregates:
 {code}
 0: jdbc:drill:schema=dfs select * from t1 where a1  ( select count(a2) + 
 count(a2) from t2);
 ++++
 | a1 | b1 | c1 |
 ++++
 ++++
 No rows selected (0.244 seconds)
 {code}



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


[jira] [Updated] (DRILL-3258) Add support for non-scalar subqueries in expressions within HAVING clause

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-3258:
--
Fix Version/s: 1.2.0

 Add support for non-scalar subqueries in expressions within HAVING clause
 -

 Key: DRILL-3258
 URL: https://issues.apache.org/jira/browse/DRILL-3258
 Project: Apache Drill
  Issue Type: Improvement
  Components: Query Planning  Optimization
Reporter: Abhishek Girish
Assignee: Sean Hsuan-Yi Chu
 Fix For: 1.2.0


 Drill currently does not support queries with non-scalar sub-queries (which 
 return more than one row) used within expressions. 
 {code:sql}
 SELECT ss_item_sk   
 FROM   store_sales 
 GROUP  BY ss_item_sk 
 HAVING Avg(ss_net_profit)  2 * 
   (SELECT avg(ss_net_profit) 
   FROM   store_sales 
   GROUP  BY ss_store_sk);
 {code}
 Such queries should be supported by Drill. 



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


[jira] [Updated] (DRILL-2335) Error message must be updated to exclude unsupported operators when queries fail to parse

2015-06-16 Thread Jinfeng Ni (JIRA)

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

Jinfeng Ni updated DRILL-2335:
--
Fix Version/s: (was: 1.1.0)
   Future

 Error message must be updated to exclude unsupported operators when queries 
 fail to parse
 -

 Key: DRILL-2335
 URL: https://issues.apache.org/jira/browse/DRILL-2335
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Reporter: Abhishek Girish
Assignee: Jinfeng Ni
Priority: Minor
 Fix For: Future


 When queries fail to parse due to errors in query syntax, an error is thrown 
 with a list of expected operators, which include some which we do not support 
 at present. 
 I understand that the SQL validation errors come from the Calcite layer. But 
 since we do not support all operators for now (for example: INTERSECT), the 
 message must be updated if possible, to correctly reflect what is supported. 
 This would make sure contradicting messages aren't thrown (for example: first 
 complaining with parse error indicating INTERSECT is a valid operator and 
 then upon correction, failing saying INTERSECT isn't supported). 
 {code:sql}
 Query failed: ParseException: Encountered ; at line 1, column 89.
 Was expecting one of:
 EOF 
 ORDER ...
 LIMIT ...
 OFFSET ...
 FETCH ...
 UNION ...
 INTERSECT ...
 EXCEPT ...
 NOT ...
 IN ...
 BETWEEN ...
 LIKE ...
 SIMILAR ...
 = ...
  ...
  ...
 = ...
 = ...
  ...
 + ...
 - ...
 * ...
 / ...
 || ...
 AND ...
 OR ...
 IS ...
 MEMBER ...
 SUBMULTISET ...
 MULTISET ...
 [ ...
 OVERLAPS ...
 YEAR ...
 MONTH ...
 DAY ...
 HOUR ...
 MINUTE ...
 SECOND ...
 Error: exception while executing query: Failure while executing query. 
 (state=,code=0)
 {code}



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


[jira] [Updated] (DRILL-2987) Inside an inner query : star should have been expanded (over CSV data)

2015-06-16 Thread Jinfeng Ni (JIRA)

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

Jinfeng Ni updated DRILL-2987:
--
Fix Version/s: 1.2.0

 Inside an inner query : star should have been expanded (over CSV data)
 --

 Key: DRILL-2987
 URL: https://issues.apache.org/jira/browse/DRILL-2987
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Affects Versions: 1.0.0
 Environment: d12bee05a8f6e974c70d5d2a94176b176d7dba5b
Reporter: Khurram Faraaz
Assignee: Jinfeng Ni
 Fix For: 1.2.0


 When there is a select * from, in an inner query, I see a message that says 
 star should be expanded. Test was executed on 4 node cluster on CentOS.
 {code}
 0: jdbc:drill: select count(tmp.columns[0]), count(tmp.columns[1]), 
 max(cast(tmp.columns[4] as double)), tmp.columns[2] from (select * from 
 `airports.csv` ) tmp;
 Error: SYSTEM ERROR: Unexpected exception during fragment initialization: 
 star should have been expanded
 [Error Id: 2ed1a83d-b0d6-43ec-bc7c-a08c3cc59284 on centos-02.qa.lab:31010] 
 (state=,code=0)
 {code}
 Stack trace from drillbit.log
 {code}
 2015-05-07 23:13:51,285 [2ab40e4f-c715-e834-c4bb-a1ad227371a9:foreman] ERROR 
 o.a.d.c.e.DrillRuntimeException - SYSTEM ERROR: Unexpected exception during 
 fragment initialization: star should have been expanded
 [Error Id: 2ed1a83d-b0d6-43ec-bc7c-a08c3cc59284 on centos-02.qa.lab:31010]
 org.apache.drill.common.exceptions.UserException: SYSTEM ERROR: Unexpected 
 exception during fragment initialization: star should have been expanded
 [Error Id: 2ed1a83d-b0d6-43ec-bc7c-a08c3cc59284 on centos-02.qa.lab:31010]
 at 
 org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:465)
  ~[drill-common-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 org.apache.drill.exec.work.foreman.Foreman$ForemanResult.close(Foreman.java:635)
  [drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 org.apache.drill.exec.work.foreman.Foreman$StateSwitch.processEvent(Foreman.java:732)
  [drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 org.apache.drill.exec.work.foreman.Foreman$StateSwitch.processEvent(Foreman.java:674)
  [drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 org.apache.drill.common.EventProcessor.sendEvent(EventProcessor.java:73) 
 [drill-common-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 org.apache.drill.exec.work.foreman.Foreman$StateSwitch.moveToState(Foreman.java:676)
  [drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 org.apache.drill.exec.work.foreman.Foreman.moveToState(Foreman.java:777) 
 [drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:212) 
 [drill-java-exec-1.0.0-SNAPSHOT-rebuffed.jar:1.0.0-SNAPSHOT]
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  [na:1.7.0_75]
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  [na:1.7.0_75]
 at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]
 Caused by: org.apache.drill.exec.work.foreman.ForemanException: Unexpected 
 exception during fragment initialization: star should have been expanded
 ... 4 common frames omitted
 Caused by: java.lang.AssertionError: star should have been expanded
 at 
 org.apache.calcite.sql.validate.AggChecker.visit(AggChecker.java:86) 
 ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at 
 org.apache.calcite.sql.validate.AggChecker.visit(AggChecker.java:37) 
 ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at 
 org.apache.calcite.sql.SqlIdentifier.accept(SqlIdentifier.java:274) 
 ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at 
 org.apache.calcite.sql.util.SqlBasicVisitor$ArgHandlerImpl.visitChild(SqlBasicVisitor.java:119)
  ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at 
 org.apache.calcite.sql.SqlOperator.acceptCall(SqlOperator.java:697) 
 ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at 
 org.apache.calcite.sql.validate.AggChecker.visit(AggChecker.java:144) 
 ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at 
 org.apache.calcite.sql.validate.AggChecker.visit(AggChecker.java:37) 
 ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:130) 
 ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at 
 org.apache.calcite.sql.util.SqlBasicVisitor$ArgHandlerImpl.visitChild(SqlBasicVisitor.java:119)
  ~[calcite-core-1.1.0-drill-r3.jar:1.1.0-drill-r3]
 at 
 org.apache.calcite.sql.SqlOperator.acceptCall(SqlOperator.java:697) 
 

[jira] [Updated] (DRILL-2929) Join query does not return results/error/exception, appears to be hung

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha updated DRILL-2929:
--
Assignee: Sean Hsuan-Yi Chu  (was: Jinfeng Ni)

 Join query does not return results/error/exception, appears to be hung
 --

 Key: DRILL-2929
 URL: https://issues.apache.org/jira/browse/DRILL-2929
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Affects Versions: 0.9.0
 Environment: f5b0f4928d9c8c47c145a179c52ba3933d85c0b4 | DRILL-1502: 
 Can't connect to mongo when requiring auth | 29.04.2015 @ 11:22:41 EDT | 
 Unknown | 29.04.2015 @ 14:44:10 EDT |
Reporter: Khurram Faraaz
Assignee: Sean Hsuan-Yi Chu
 Fix For: 1.1.0


 multi way equi join query hangs on rpm version based on 29th. Explain plan 
 does not return anything, web UI shows query as PENDING state. Test was run 
 on 4 node cluster on CentOS. There are no errors/exceptions reported in 
 drillbit.log
 Hanging query is,
 {code}
 0: jdbc:drill: select bi.columns[0], ci.columns[0], di.columns[0], 
 fi.columns[0], ini.columns[0], vi.columns[0]
 . . . . . . .  from `bgint_f.csv` bi,
 . . . . . . .  `char_f.csv` ci,
 . . . . . . .  `dbl_f.csv` di,
 . . . . . . .  `float_f.csv` fi,
 . . . . . . .  `int_f.csv` ini,
 . . . . . . .  `vchar_f.csv` vi
 . . . . . . .  where bi.columns[0] = ci.columns[0]
 . . . . . . .  and di.columns[0] = fi.columns[0]
 . . . . . . .  and ini.columns[0] = vi.columns[0]
 . . . . . . .  and ci.columns[0] = di.columns[0]
 . . . . . . .  and fi.columns[0] = ini.columns[0]
 . . . . . . .  and ci.columns[0] = ini.columns[0];
 {code}
 Data used in test is
 {code}
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/bgint_f.csv
 1
 2
 0
 -1
 100
 65535
 100
 13
 19
 17
 11
 1010101
 999
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/char_f.csv
 1
 2
 3
 4
 5
 6
 7
 8
 9
 0
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/dbl_f.csv
 123.45
 11.98
 12345.39
 1.1
 1.0
 0.0
 -1.0
 1.99
 9.99
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/float_f.csv
 1.1
 1.234
 1234.19
 13.19
 1.0
 -1.0
 0.0
 .98
 .99
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/int_f.csv
 1
 0
 -1
 65535
 1234567
 100
 101010
 1
 100
 13
 19
 17
 [root@centos-04 join_hang]# hadoop fs -cat /tmp/vchar_f.csv
 12345
 1
 0
 -1
 20
 100
 65535
 13
 19
 17
 1
 10101
 {code}



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


[jira] [Assigned] (DRILL-3292) SUM(constant) OVER(...) returns wrong results

2015-06-16 Thread Aman Sinha (JIRA)

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

Aman Sinha reassigned DRILL-3292:
-

Assignee: Aman Sinha  (was: Deneche A. Hakim)

 SUM(constant) OVER(...) returns wrong results
 -

 Key: DRILL-3292
 URL: https://issues.apache.org/jira/browse/DRILL-3292
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Relational Operators, Query Planning  
 Optimization
Affects Versions: 1.0.0
Reporter: Deneche A. Hakim
Assignee: Aman Sinha
 Fix For: 1.1.0


 The following query returns wrong results:
 {noformat}
 0: jdbc:drill: select sum(1) over w sum1, sum(5) over w sum5 from 
 cp.`employee.json` where position_id = 2 window w as (partition by 
 position_id);
 +---+---+
 | sum1  | sum5  |
 +---+---+
 | 6 | 6 |
 | 6 | 6 |
 | 6 | 6 |
 | 6 | 6 |
 | 6 | 6 |
 | 6 | 6 |
 +---+---+
 {noformat}
 The second column should display 30 (5 x 6) instead of 6.
 Here is the plan for the query:
 {noformat}
 00-00Screen
 00-01  Project(sum1=[$0], sum5=[$1])
 00-02Project(sum1=[$0], sum5=[$1])
 00-03  Project($0=[$1], $1=[$2])
 00-04Window(window#0=[window(partition {0} order by [] range 
 between UNBOUNDED PRECEDING and UNBOUNDED FOLLOWING aggs [SUM($1), SUM($2)])])
 00-05  SelectionVectorRemover
 00-06Sort(sort0=[$0], dir0=[ASC])
 00-07  Filter(condition=[=($0, 2)])
 00-08Scan(groupscan=[EasyGroupScan 
 [selectionRoot=/employee.json, numFiles=1, columns=[`position_id`], 
 files=[classpath:/employee.json]]])
 {noformat}



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


[jira] [Updated] (DRILL-2903) Update TestDrillbitResilience tests so that they correctly manage canceled queries that get to complete too quickly.

2015-06-16 Thread Sudheesh Katkam (JIRA)

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

Sudheesh Katkam updated DRILL-2903:
---
Attachment: DRILL-2903.3.patch.txt

 Update TestDrillbitResilience tests so that they correctly manage canceled 
 queries that get to complete too quickly.
 

 Key: DRILL-2903
 URL: https://issues.apache.org/jira/browse/DRILL-2903
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Reporter: Jacques Nadeau
Assignee: Sudheesh Katkam
Priority: Critical
 Fix For: 1.1.0

 Attachments: DRILL-2903.3.patch.txt


 Due to timing issues, this test currently appears to flap.  We need to update 
 it so that this isn't an issue and then reenable it.



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


[jira] [Created] (DRILL-3302) Unable to build drill

2015-06-16 Thread Levi Page (JIRA)
Levi Page created DRILL-3302:


 Summary: Unable to build drill
 Key: DRILL-3302
 URL: https://issues.apache.org/jira/browse/DRILL-3302
 Project: Apache Drill
  Issue Type: Bug
Reporter: Levi Page


I'm new to mnv and the java world in general so i may be doing something wrong, 
but looks like someone misspelled the word install somewhere in the build 
configuration:
[ERROR] Unknown lifecycle phase insatll. 

You must specify a valid lifecycle phase or a goal in the format 
plugin-prefix:goal or 
plugin-group-id:plugin-artifact-id[:plugin-version]:goal. Available 
lifecycle phases are: validate, initialize, generate-sources, process-sources, 
generate-resources, process-resources, compile, process-classes, 
generate-test-sources, process-test-sources, generate-test-resources, 
process-test-resources, test-compile, process-test-classes, test, 
prepare-package, package, pre-integration-test, integration-test, 
post-integration-test, verify, install, deploy, pre-site, site, post-site, 
site-deploy, pre-clean, clean, post-clean. - [Help 1]

I installed like so:
$ git clone https://github.com/apache/drill.git
$ mvn clean install




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


[jira] [Closed] (DRILL-3302) Unable to build drill

2015-06-16 Thread Levi Page (JIRA)

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

Levi Page closed DRILL-3302.

Resolution: Invalid

mistake on my end

 Unable to build drill
 -

 Key: DRILL-3302
 URL: https://issues.apache.org/jira/browse/DRILL-3302
 Project: Apache Drill
  Issue Type: Bug
Reporter: Levi Page

 I'm new to mnv and the java world in general so i may be doing something 
 wrong, but looks like someone misspelled the word install somewhere in the 
 build configuration:
 [ERROR] Unknown lifecycle phase insatll. 
 You must specify a valid lifecycle phase or a goal in the format 
 plugin-prefix:goal or 
 plugin-group-id:plugin-artifact-id[:plugin-version]:goal. Available 
 lifecycle phases are: validate, initialize, generate-sources, 
 process-sources, generate-resources, process-resources, compile, 
 process-classes, generate-test-sources, process-test-sources, 
 generate-test-resources, process-test-resources, test-compile, 
 process-test-classes, test, prepare-package, package, pre-integration-test, 
 integration-test, post-integration-test, verify, install, deploy, pre-site, 
 site, post-site, site-deploy, pre-clean, clean, post-clean. - [Help 1]
 I installed like so:
 $ git clone https://github.com/apache/drill.git
 $ mvn clean install



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


[jira] [Created] (DRILL-3303) Build doesn't support recent version of Java

2015-06-16 Thread Levi Page (JIRA)
Levi Page created DRILL-3303:


 Summary: Build doesn't support recent version of Java
 Key: DRILL-3303
 URL: https://issues.apache.org/jira/browse/DRILL-3303
 Project: Apache Drill
  Issue Type: Bug
Reporter: Levi Page


I am unable to build drill. I get the following error:
Failed to execute goal 
org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce 
(validate_java_and_maven_version) on project drill-root: Some Enforcer rules 
have failed. Look above for specific messages explaining why the rule failed. 
- [Help 1]

It looks like my java version is too recent. Do I need to install an old 
version or should this be updated in the build configuration? 
[WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed 
with message:
Detected JDK Version: 1.8.0-45 is not in the allowed range [1.7,1.8).

I followed these steps:
git clone https://github.com/apache/drill.git
mvn clean install



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


[jira] [Commented] (DRILL-3303) Build doesn't support recent version of Java

2015-06-16 Thread Levi Page (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14589186#comment-14589186
 ] 

Levi Page commented on DRILL-3303:
--

Updating my copy of pom.xml to 1.7,1.9 fixed the issue. I'm not experienced 
with git and new to java or I would push a merge request, but hopefully someone 
can put this in.

 Build doesn't support recent version of Java
 

 Key: DRILL-3303
 URL: https://issues.apache.org/jira/browse/DRILL-3303
 Project: Apache Drill
  Issue Type: Bug
Reporter: Levi Page

 I am unable to build drill. I get the following error:
 Failed to execute goal 
 org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce 
 (validate_java_and_maven_version) on project drill-root: Some Enforcer rules 
 have failed. Look above for specific messages explaining why the rule failed. 
 - [Help 1]
 It looks like my java version is too recent. Do I need to install an old 
 version or should this be updated in the build configuration? 
 [WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed 
 with message:
 Detected JDK Version: 1.8.0-45 is not in the allowed range [1.7,1.8).
 I followed these steps:
 git clone https://github.com/apache/drill.git
 mvn clean install



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


[jira] [Closed] (DRILL-3303) Build doesn't support recent version of Java

2015-06-16 Thread Chris Westin (JIRA)

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

Chris Westin closed DRILL-3303.
---
Resolution: Duplicate

 Build doesn't support recent version of Java
 

 Key: DRILL-3303
 URL: https://issues.apache.org/jira/browse/DRILL-3303
 Project: Apache Drill
  Issue Type: Bug
Reporter: Levi Page

 I am unable to build drill. I get the following error:
 Failed to execute goal 
 org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce 
 (validate_java_and_maven_version) on project drill-root: Some Enforcer rules 
 have failed. Look above for specific messages explaining why the rule failed. 
 - [Help 1]
 It looks like my java version is too recent. Do I need to install an old 
 version or should this be updated in the build configuration? 
 [WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed 
 with message:
 Detected JDK Version: 1.8.0-45 is not in the allowed range [1.7,1.8).
 I followed these steps:
 git clone https://github.com/apache/drill.git
 mvn clean install



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


[jira] [Updated] (DRILL-3262) Rename missed .impl.DrillDatabaseMetaData to .impl.DrillDatabaseMetaDataImpl to

2015-06-16 Thread Daniel Barclay (Drill) (JIRA)

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

Daniel Barclay (Drill) updated DRILL-3262:
--
Attachment: DRILL-3262.5.patch.txt

 Rename missed .impl.DrillDatabaseMetaData to .impl.DrillDatabaseMetaDataImpl 
 to 
 

 Key: DRILL-3262
 URL: https://issues.apache.org/jira/browse/DRILL-3262
 Project: Apache Drill
  Issue Type: Bug
Reporter: Daniel Barclay (Drill)
Assignee: Daniel Barclay (Drill)
 Fix For: 1.1.0

 Attachments: DRILL-3262.2.patch.txt, DRILL-3262.3.patch.txt, 
 DRILL-3262.4.patch.txt, DRILL-3262.5.patch.txt, DRILL-3262.BASE.2.patch.txt, 
 DRILL-3262.BASE.3.patch.txt, DRILL-3262.BASE.4.patch.txt


 Renamed current org.apache.drill.jdbc.impl.DrillDatabaseMetaData to 
 DrillDatabaseMetaDataImpl.  (Was missed in DRILL-2089 move/renaming.)



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


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

2015-06-16 Thread Daniel Barclay (Drill) (JIRA)

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

Daniel Barclay (Drill) updated DRILL-3216:
--
Attachment: DRILL-3216.2Core.6.patch.txt
DRILL-3216.1Hygiene.6.patch.txt

 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)
Assignee: Daniel Barclay (Drill)
 Fix For: 1.1.0

 Attachments: DRILL-3216.1Hygiene.4.patch.txt, 
 DRILL-3216.1Hygiene.6.patch.txt, DRILL-3216.1HygieneBASE.4.patch.txt, 
 DRILL-3216.2Core.4.patch.txt, DRILL-3216.2Core.5.patch.txt, 
 DRILL-3216.2Core.6.patch.txt, DRILL-3216.2CoreBASE.4.patch.txt


 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.
 Change column {{DATA_TYPE}} from short names (e.g., CHAR) to specified 
 names (e.g., CHARACTER).
 - CHAR - CHARACTER
 - VARCHAR - CHARACTER VARYING 
 - VARBINARY - BINARY VARYING
 - ... ARRAY - ARRAY
 - STRUCT (...) - STRUCT
 - ((...) MAP - MAP (extension to standard, but follows standard's 
 pattern))
 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}}.
 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.
 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.
 Update implementation of JDBC's {{DatabaseMeta.getColumns()}}:
 - first, enough to not break
 - second, to use newly available data to fix some partial implementations.



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


[jira] [Updated] (DRILL-3198) JDBC driver returns null from DatabaseMetaData.getTypeInfo(...)

2015-06-16 Thread Daniel Barclay (Drill) (JIRA)

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

Daniel Barclay (Drill) updated DRILL-3198:
--
Attachment: DRILL-3198.5.patch.txt

 JDBC driver returns null from DatabaseMetaData.getTypeInfo(...)
 ---

 Key: DRILL-3198
 URL: https://issues.apache.org/jira/browse/DRILL-3198
 Project: Apache Drill
  Issue Type: Bug
  Components: Client - JDBC
Affects Versions: 1.0.0
Reporter: Matt Keranen
Assignee: Daniel Barclay (Drill)
 Fix For: 1.1.0

 Attachments: DRILL-3198.4.patch.txt, DRILL-3198.5.patch.txt, 
 DRILL-3198.BASE.4.patch.txt


 JDBC driver returns null from DatabaseMetaData#getTypeInfo() instead of a 
 ResultSet, causing some client tools to throw NPEs.
 Driver works with SquirrelSQL (http://drill.apache.org/docs/using-jdbc/), but 
 fails with others (DbVisualizer for example).



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


[jira] [Commented] (DRILL-3298) Wrong result with SUM window function and order by without partition by in the OVER clause

2015-06-16 Thread Aman Sinha (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-3298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14589218#comment-14589218
 ] 

Aman Sinha commented on DRILL-3298:
---

[~adeneche] were you asking about the final sort or the sort that is input to 
the window function ?  Also, what is the semantics of a window aggregate if 
there is no partition-by clause  but there's an order-by ? If the semantics is 
that the order-by column should be treated as a 'partitioning' column, then we 
would need to insert a HashToRandomExchange below the Sort that is input to the 
Window operator. 

Let me illustrate the issue with a simpler example below.  I removed the final 
order-by, added a filter condition to reduce the result set and am just doing a 
COUNT instead of SUM.  

slice_target = 1:  // incorrect result
{code}
select c_integer, count(*) over (order by c_integer) as cnt
 from j1 where c_integer in (447503383, 452697297, 456808172) ;

++--+
| c_integer  | cnt  |
++--+
| 456808172  | 1|
| 447503383  | 2|
| 447503383  | 2|
| 452697297  | 4|
| 452697297  | 4|
| 456808172  | 5|
| 447503383  | 2|
| 447503383  | 2|
| 456808172  | 2|
| 456808172  | 2|
++--+
{code}

slice_target = 10:  // correct result
{code}
++--+
| c_integer  | cnt  |
++--+
| 447503383  | 4|
| 447503383  | 4|
| 447503383  | 4|
| 447503383  | 4|
| 452697297  | 6|
| 452697297  | 6|
| 456808172  | 10   |
| 456808172  | 10   |
| 456808172  | 10   |
| 456808172  | 10   |
++--+
{code}

Note that in the incorrect result, not only are the the 'cnt' values incorrect, 
 they are not the same for all rows of 456808172.  
So it seems to me that each minor fragment of the window is computing its own 
COUNT and that is not being set for all identical values of c_integer.   If you 
can verify this, I think adding a distribution step below the Sort would 
resolve it.  I can work on adding that. 
 

 Wrong result with SUM window function and order by without partition by in 
 the OVER clause
 --

 Key: DRILL-3298
 URL: https://issues.apache.org/jira/browse/DRILL-3298
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Flow
Affects Versions: 1.0.0
Reporter: Victoria Markman
Assignee: Deneche A. Hakim
Priority: Critical
  Labels: window_function
 Fix For: 1.1.0

 Attachments: j1.tar, test.res


 This query returns incorrect result when planner.slice_target = 1
 {code}
 select
 j1.c_integer,
 sum(j1.c_integer) over w
 from j1
 window  w as (order by c_integer desc)
 order by
 1, 2;
 {code}
 Query plan with planner.slice_target = 1
 {noformat}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SingleMergeExchange(sort0=[0 ASC], sort1=[1 ASC])
 01-01  SelectionVectorRemover
 01-02Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 01-03  Project(c_integer=[$0], EXPR$1=[$1])
 01-04HashToRandomExchange(dist0=[[$0]], dist1=[[$1]])
 02-01  UnorderedMuxExchange
 03-01Project(c_integer=[$0], EXPR$1=[$1], 
 E_X_P_R_H_A_S_H_F_I_E_L_D=[castInt(hash64AsDouble($1, hash64AsDouble($0)))])
 03-02  Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), 
 CAST($2):ANY, null)])
 03-03Window(window#0=[window(partition {} order by [0 
 DESC] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 03-04  SelectionVectorRemover
 03-05Sort(sort0=[$0], dir0=[DESC])
 03-06  Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {noformat}
 Query plan with planner.slice_target = 10;
 {noformat}
 00-01  Project(c_integer=[$0], EXPR$1=[$1])
 00-02SelectionVectorRemover
 00-03  Sort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC])
 00-04Project(c_integer=[$0], EXPR$1=[CASE(($1, 0), CAST($2):ANY, 
 null)])
 00-05  Window(window#0=[window(partition {} order by [0 DESC] 
 range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT($0), 
 $SUM0($0)])])
 00-06SelectionVectorRemover
 00-07  Sort(sort0=[$0], dir0=[DESC])
 00-08Scan(groupscan=[ParquetGroupScan 
 [entries=[ReadEntryWithPath [path=maprfs:///drill/testdata/subqueries/j1]], 
 selectionRoot=/drill/testdata/subqueries/j1, numFiles=1, 
 columns=[`c_integer`]]])
 {noformat}
 

[jira] [Updated] (DRILL-2101) Decimal literals are treated as double

2015-06-16 Thread Mehant Baid (JIRA)

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

Mehant Baid updated DRILL-2101:
---
Fix Version/s: (was: 1.1.0)
   Future

 Decimal literals are treated as double
 --

 Key: DRILL-2101
 URL: https://issues.apache.org/jira/browse/DRILL-2101
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Data Types
Affects Versions: 0.8.0
Reporter: Victoria Markman
Assignee: Mehant Baid
 Fix For: Future

 Attachments: DRILL-2101-PARTIAL-PATCH-enable-decimal-literals.patch, 
 DRILL-2101.patch


 {code}
 create table t1(c1) as
 select
 cast(null as decimal(28,4))
 from `t1.csv`;
 message root {
   optional double c1; -- Wrong, should be decimal
 }
 {code}
 This is very commonly used construct to convert csv files to parquet files, 
 that's why I'm marking this bug as critical.
 {code}
 create table t2 as 
 select
 case when columns[3] = '' then cast(null as decimal(28,4)) else 
 cast(columns[3] as decimal(28, 4)) end
 from `t1.csv`;
 {code}
 Correct - cast string literal to decimal
 {code}
 create table t3(c1) as
 select
 cast('12345678901234567890.1234' as decimal(28,4))
 from `t1.csv`;
 message root {
   required fixed_len_byte_array(12) c1 (DECIMAL(28,4));
 }
 {code}
 Correct - cast literal from csv file as decimal
 {code}
 create table t4(c1) as
 select
 cast(columns[3] as decimal(28,4))
 from `t1.csv`;
 message root {
   optional fixed_len_byte_array(12) c1 (DECIMAL(28,4));
 }
 {code}
 Correct - case statement (no null involved)
 {code}
 create table t5(c1) as
 select
 case when columns[3] = '' then cast('' as decimal(28,4)) else 
 cast(columns[3] as decimal(28,4)) end
 from `t1.csv`;
 message root {
   optional fixed_len_byte_array(12) c1 (DECIMAL(28,4));
 }
 {code}



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


[jira] [Updated] (DRILL-1706) date_sub function does not accept string as input in Drill

2015-06-16 Thread Mehant Baid (JIRA)

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

Mehant Baid updated DRILL-1706:
---
Fix Version/s: (was: 1.1.0)
   1.2.0

 date_sub function does not accept string as input in Drill
 --

 Key: DRILL-1706
 URL: https://issues.apache.org/jira/browse/DRILL-1706
 Project: Apache Drill
  Issue Type: New Feature
  Components: Functions - Drill, Functions - Hive
Affects Versions: 0.7.0
Reporter: Hao Zhu
Assignee: Mehant Baid
 Fix For: 1.2.0


 date_sub function does not accept string as input in Drill, however it does 
 in Hive.
 This different behavior of the function will make customer re-write their 
 query to use cast as date.
 Minimum reproduce :
 {code}
 0: jdbc:drill:zk=local select date_sub('2014-11-12 16:45:22',15) from 
 dfs.tmp.`drilltest/test.csv` ;
 Query failed: Failure while running fragment., Invalid format: 2014-11-12 
 16:45:22 is malformed at 14-11-12 16:45:22 [ 
 9a6f18da-eb1e-4d91-879a-8d9d528efd59 on 10.250.0.115:31010 ]
   (java.lang.IllegalArgumentException) Invalid format: 2014-11-12 16:45:22 
 is malformed at 14-11-12 16:45:22
 org.joda.time.format.DateTimeFormatter.parseDateTime():873
 org.apache.drill.exec.test.generated.ProjectorGen23.doSetup():63
 org.apache.drill.exec.test.generated.ProjectorGen23.setup():97
 
 org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.setupNewSchema():427
 
 org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.buildSchema():270
 
 org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.buildSchema():80
 
 org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.buildSchema():95
 org.apache.drill.exec.work.fragment.FragmentExecutor.run():111
 org.apache.drill.exec.work.WorkManager$RunnableWrapper.run():249
 ...():0
 Error: exception while executing query: Failure while executing query. 
 (state=,code=0)
 {code}
 Comparing to Hive which is good.
 {code}
 0: jdbc:hive2://n1a:1/default select date_sub('2014-11-12 16:45:22',15) 
 from passwords limit 1 ; 
 +-+
 | _c0 |
 +-+
 | 2014-10-28  |
 +-+
 1 row selected (6.568 seconds)
 {code}
 Workaround in Drill:
 {code}
 0: jdbc:drill:zk=local select date_sub(cast('2014-11-12 16:45:22' as 
 date),15) from dfs.tmp.`drilltest/test.csv` ;
 ++
 |   EXPR$0   |
 ++
 | 2014-10-28 |
 ++
 1 row selected (0.082 seconds)
 {code}



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


[jira] [Updated] (DRILL-2549) Implicit Cast between integer and varchar columns in a join should work

2015-06-16 Thread Mehant Baid (JIRA)

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

Mehant Baid updated DRILL-2549:
---
Fix Version/s: (was: 1.1.0)
   Future

 Implicit Cast between integer and varchar columns in a join should work
 ---

 Key: DRILL-2549
 URL: https://issues.apache.org/jira/browse/DRILL-2549
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Relational Operators
Reporter: Rahul Challapalli
Assignee: Mehant Baid
 Fix For: Future

 Attachments: error.log, fewtypes.tbl, fewtypes_null.parquet


 git.commit.id.abbrev=f1b59ed
 I attached 2 files which contain the same values
 The below query is not doing an implicit cast between a varchar and an integer
 {code}
 select count(*) from dfs.`cross-sources`.`fewtypes_null.parquet` p
 inner join dfs.`cross-sources`.`fewtypes_null.tbl` o
 on p.int_col=o.columns[0];
 Query failed: RemoteRpcException: Failure while running fragment., Failure 
 finding function that runtime code generation expected.  Signature: 
 compare_to_nulls_high( INT:OPTIONAL, VARCHAR:OPTIONAL ) returns INT:REQUIRED 
 [ 08df7d57-c436-4ff8-9a31-48368ba05531 on qa-node190.qa.lab:31010 ]
 [ 08df7d57-c436-4ff8-9a31-48368ba05531 on qa-node190.qa.lab:31010 ]
 {code}



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


[jira] [Updated] (DRILL-1650) Add support for repeated_count multi-level array data type?

2015-06-16 Thread Mehant Baid (JIRA)

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

Mehant Baid updated DRILL-1650:
---
Fix Version/s: (was: 1.1.0)
   1.2.0

 Add support for repeated_count multi-level array data type?
 ---

 Key: DRILL-1650
 URL: https://issues.apache.org/jira/browse/DRILL-1650
 Project: Apache Drill
  Issue Type: Improvement
  Components: Functions - Drill
Affects Versions: 0.6.0
Reporter: Hao Zhu
Assignee: Mehant Baid
 Fix For: 1.2.0


 1. n1.json is :
 {code}
 {test:[1,2,3,4,4,5]}
 {code}
 Then the function works fine:
 {code}
 0: jdbc:drill: select repeated_count(t.test) from `n1.json` as t;
 ++
 |   EXPR$0   |
 ++
 | 6  |
 ++
 {code}
 2. However if the json has 2-level or more arrays:
 {code}
 {test:[[1,2,3,4,5,6]]}
 {code}
 The function failed:
 {code}
 0: jdbc:drill: select t.test[0][0],t.test[0][1] from `n4.json` as t;
 +++
 |   EXPR$0   |   EXPR$1   |
 +++
 | 1  | 2  |
 +++
 1 row selected (0.126 seconds)
 0: jdbc:drill: select repeated_count(t.test[0]) from `n4.json` as t;
 Query failed: Screen received stop request sent. Line 54, Column 22: end is 
 neither a method, a field, nor a member class of 
 org.apache.drill.exec.vector.complex.reader.FieldReader 
 [11c5ff5b-c00f-4754-9bda-c3bec9471f72]
 Error: exception while executing query: Failure while trying to get next 
 result batch. (state=,code=0)
 {code}
 Am I missing something or is this a bug?



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


[jira] [Updated] (DRILL-2538) Project's setupNewSchema() does not create the correct schema for complex vectors with children

2015-06-16 Thread Mehant Baid (JIRA)

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

Mehant Baid updated DRILL-2538:
---
Fix Version/s: (was: 1.1.0)
   1.2.0

 Project's setupNewSchema() does not create the correct schema for complex 
 vectors with children
 ---

 Key: DRILL-2538
 URL: https://issues.apache.org/jira/browse/DRILL-2538
 Project: Apache Drill
  Issue Type: Bug
  Components: Execution - Data Types
Reporter: Mehant Baid
Assignee: Mehant Baid
 Fix For: 1.2.0


 While creating the schema for the outgoing batch in project 
 (setupNewSchema()) we don't create the child vectors for the complex vectors. 
 We create the children only while performing the transfer in doWork(). This 
 is ok for most cases, but if we have a blocking operator before project and  
 our first batch is a schema batch with no records then the transfer would not 
 create the child vectors and we would propagate half baked schema downstream. 



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


[jira] [Updated] (DRILL-3011) Make Prel.copy abstract and implement for all nodes

2015-06-16 Thread Mehant Baid (JIRA)

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

Mehant Baid updated DRILL-3011:
---
Fix Version/s: (was: 1.1.0)
   1.2.0

 Make Prel.copy abstract and implement for all nodes
 ---

 Key: DRILL-3011
 URL: https://issues.apache.org/jira/browse/DRILL-3011
 Project: Apache Drill
  Issue Type: Bug
  Components: Query Planning  Optimization
Reporter: Jacques Nadeau
Assignee: Mehant Baid
 Fix For: 1.2.0


 There is currently an issue where inherit copy() from BaseRelNode.  Late in 
 our planning process, we attempt to uniqify the graph to ensure that no nodes 
 have the same identifier.  However, the fact that we aren't implementing copy 
 means that we have issues uniqifying.  We should add the following method to 
 the Prel interface and then implement all required implementations.
 public abstract Prel copy(RelTraitSet paramRelTraitSet, ListRelNode 
 paramList);



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


[jira] [Updated] (DRILL-2125) Add input template file in the source files generated by freemarker

2015-06-16 Thread Mehant Baid (JIRA)

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

Mehant Baid updated DRILL-2125:
---
Fix Version/s: (was: 1.1.0)
   1.2.0

 Add input template file in the source files generated by freemarker
 ---

 Key: DRILL-2125
 URL: https://issues.apache.org/jira/browse/DRILL-2125
 Project: Apache Drill
  Issue Type: Improvement
  Components: Tools, Build  Test
Reporter: Mehant Baid
Assignee: Mehant Baid
 Fix For: 1.2.0

 Attachments: DRILL-2125.patch


 Currently only some generated source files include information as to which 
 template was used to create the sources. For better readability and modifying 
 the template it'd be good to include which template was used to generate the 
 sources.



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


[jira] [Updated] (DRILL-2419) UDF that returns string representation of expression type

2015-06-16 Thread Mehant Baid (JIRA)

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

Mehant Baid updated DRILL-2419:
---
Fix Version/s: (was: 1.1.0)
   1.2.0

 UDF that returns string representation of expression type
 -

 Key: DRILL-2419
 URL: https://issues.apache.org/jira/browse/DRILL-2419
 Project: Apache Drill
  Issue Type: Improvement
  Components: Functions - Drill
Reporter: Victoria Markman
Assignee: Mehant Baid
 Fix For: 1.2.0


 Suggested name: typeof (credit goes to Aman)



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