[jira] [Commented] (DRILL-4510) IllegalStateException: Failure while reading vector. Expected vector class of org.apache.drill.exec.vector.NullableIntVector but was holding vector class org.apache.dri

2017-01-12 Thread Khurram Faraaz (JIRA)

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

Khurram Faraaz commented on DRILL-4510:
---

TPC-DS query 66 fails on SF100 data on Drill 1.10.0 ( ee399317 ) on a 4 node 
cluster.
Can someone please take a look at this one, there is a PR open for this.

> IllegalStateException: Failure while reading vector. Expected vector class of 
> org.apache.drill.exec.vector.NullableIntVector but was holding vector class 
> org.apache.drill.exec.vector.NullableVarCharVector
> 
>
> Key: DRILL-4510
> URL: https://issues.apache.org/jira/browse/DRILL-4510
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Execution - Data Types
>Reporter: Chun Chang
>Assignee: Sean Hsuan-Yi Chu
>Priority: Critical
>
> Hit the following regression running advanced automation. Regression happened 
> between commit b979bebe83d7017880b0763adcbf8eb80acfcee8 and 
> 1f23b89623c72808f2ee866cec9b4b8a48929d68
> {noformat}
> Execution Failures:
> /root/drillAutomation/framework-master/framework/resources/Advanced/tpcds/tpcds_sf100/original/query66.sql
> Query: 
> -- start query 66 in stream 0 using template query66.tpl 
> SELECT w_warehouse_name, 
>w_warehouse_sq_ft, 
>w_city, 
>w_county, 
>w_state, 
>w_country, 
>ship_carriers, 
>year1,
>Sum(jan_sales) AS jan_sales, 
>Sum(feb_sales) AS feb_sales, 
>Sum(mar_sales) AS mar_sales, 
>Sum(apr_sales) AS apr_sales, 
>Sum(may_sales) AS may_sales, 
>Sum(jun_sales) AS jun_sales, 
>Sum(jul_sales) AS jul_sales, 
>Sum(aug_sales) AS aug_sales, 
>Sum(sep_sales) AS sep_sales, 
>Sum(oct_sales) AS oct_sales, 
>Sum(nov_sales) AS nov_sales, 
>Sum(dec_sales) AS dec_sales, 
>Sum(jan_sales / w_warehouse_sq_ft) AS jan_sales_per_sq_foot, 
>Sum(feb_sales / w_warehouse_sq_ft) AS feb_sales_per_sq_foot, 
>Sum(mar_sales / w_warehouse_sq_ft) AS mar_sales_per_sq_foot, 
>Sum(apr_sales / w_warehouse_sq_ft) AS apr_sales_per_sq_foot, 
>Sum(may_sales / w_warehouse_sq_ft) AS may_sales_per_sq_foot, 
>Sum(jun_sales / w_warehouse_sq_ft) AS jun_sales_per_sq_foot, 
>Sum(jul_sales / w_warehouse_sq_ft) AS jul_sales_per_sq_foot, 
>Sum(aug_sales / w_warehouse_sq_ft) AS aug_sales_per_sq_foot, 
>Sum(sep_sales / w_warehouse_sq_ft) AS sep_sales_per_sq_foot, 
>Sum(oct_sales / w_warehouse_sq_ft) AS oct_sales_per_sq_foot, 
>Sum(nov_sales / w_warehouse_sq_ft) AS nov_sales_per_sq_foot, 
>Sum(dec_sales / w_warehouse_sq_ft) AS dec_sales_per_sq_foot, 
>Sum(jan_net)   AS jan_net, 
>Sum(feb_net)   AS feb_net, 
>Sum(mar_net)   AS mar_net, 
>Sum(apr_net)   AS apr_net, 
>Sum(may_net)   AS may_net, 
>Sum(jun_net)   AS jun_net, 
>Sum(jul_net)   AS jul_net, 
>Sum(aug_net)   AS aug_net, 
>Sum(sep_net)   AS sep_net, 
>Sum(oct_net)   AS oct_net, 
>Sum(nov_net)   AS nov_net, 
>Sum(dec_net)   AS dec_net 
> FROM   (SELECT w_warehouse_name, 
>w_warehouse_sq_ft, 
>w_city, 
>w_county, 
>w_state, 
>w_country, 
>'ZOUROS' 
>|| ',' 
>|| 'ZHOU' AS ship_carriers, 
>d_yearAS year1, 
>Sum(CASE 
>  WHEN d_moy = 1 THEN ws_ext_sales_price * ws_quantity 
>  ELSE 0 
>END)  AS jan_sales, 
>Sum(CASE 
>  WHEN d_moy = 2 THEN ws_ext_sales_price * ws_quantity 
>  ELSE 0 
>END)  AS feb_sales, 
>   

[jira] [Commented] (DRILL-5194) UDF returns NULL as expected only if the input is a literal

2017-01-12 Thread Muhammad Gelbana (JIRA)

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

Muhammad Gelbana commented on DRILL-5194:
-

This issue duplicates this one: https://issues.apache.org/jira/browse/DRILL-5193

> UDF returns NULL as expected only if the input is a literal
> ---
>
> Key: DRILL-5194
> URL: https://issues.apache.org/jira/browse/DRILL-5194
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Functions - Drill
>Affects Versions: 1.9.0
>Reporter: Muhammad Gelbana
>
> I defined the following UDF
> {code:title=SplitPartFunc.java|borderStyle=solid}
> import javax.inject.Inject;
> import org.apache.drill.exec.expr.DrillSimpleFunc;
> import org.apache.drill.exec.expr.annotations.FunctionTemplate;
> import org.apache.drill.exec.expr.annotations.Output;
> import org.apache.drill.exec.expr.annotations.Param;
> import org.apache.drill.exec.expr.holders.IntHolder;
> import org.apache.drill.exec.expr.holders.NullableVarCharHolder;
> import org.apache.drill.exec.expr.holders.VarCharHolder;
> import io.netty.buffer.DrillBuf;
> @FunctionTemplate(name = "split_string", scope = 
> FunctionTemplate.FunctionScope.SIMPLE, nulls = 
> FunctionTemplate.NullHandling.NULL_IF_NULL)
> public class SplitPartFunc implements DrillSimpleFunc {
> @Param
> VarCharHolder input;
> @Param(constant = true)
> VarCharHolder delimiter;
> @Param(constant = true)
> IntHolder field;
> @Output
> NullableVarCharHolder out;
> @Inject
> DrillBuf buffer;
> public void setup() {
> }
> public void eval() {
> String stringValue = 
> org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input.start,
>  input.end, input.buffer);
> out.buffer = buffer; //If I return before this statement, a NPE is 
> thrown :(
> if(stringValue == null){
> return;
> }
> int fieldValue = field.value;
> if(fieldValue <= 0){
> return; 
> }
> String delimiterValue = 
> org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(delimiter.start,
>  delimiter.end, delimiter.buffer);
> if(delimiterValue == null){
> return;
> }
> String[] splittedInput = stringValue.split(delimiterValue);
> if(splittedInput.length < fieldValue){
> return;
> }
> // put the output value in the out buffer
> String outputValue = splittedInput[fieldValue - 1];
> out.start = 0;
> out.end = outputValue.getBytes().length;
> buffer.setBytes(0, outputValue.getBytes());
> out.isSet = 1;
> }
> }
> {code}
> If I run the following query on the sample employees.json file (or actually a 
> parquet, after modifying the table and columns names)
> {code:title=SQL Query|borderStyle=solid}SELECT full_name, 
> split_string(full_name, ' ', 4), split_string('Whatever', ' ', 4) FROM 
> cp.employee.json LIMIT 1{code}
> I get the following result
> !https://i.stack.imgur.com/L8uQW.png!
> Shouldn't I be getting the column value and null for the other 2 columns ?



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


[jira] [Updated] (DRILL-5193) UDF returns NULL as expected only if the input is a literal

2017-01-12 Thread Muhammad Gelbana (JIRA)

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

Muhammad Gelbana updated DRILL-5193:

Description: 
I defined the following UDF
{code:title=SplitPartFunc.java|borderStyle=solid}
import javax.inject.Inject;

import org.apache.drill.exec.expr.DrillSimpleFunc;
import org.apache.drill.exec.expr.annotations.FunctionTemplate;
import org.apache.drill.exec.expr.annotations.Output;
import org.apache.drill.exec.expr.annotations.Param;
import org.apache.drill.exec.expr.holders.IntHolder;
import org.apache.drill.exec.expr.holders.NullableVarCharHolder;
import org.apache.drill.exec.expr.holders.VarCharHolder;

import io.netty.buffer.DrillBuf;

@FunctionTemplate(name = "split_string", scope = 
FunctionTemplate.FunctionScope.SIMPLE, nulls = 
FunctionTemplate.NullHandling.NULL_IF_NULL)
public class SplitPartFunc implements DrillSimpleFunc {

@Param
VarCharHolder input;

@Param(constant = true)
VarCharHolder delimiter;

@Param(constant = true)
IntHolder field;

@Output
NullableVarCharHolder out;

@Inject
DrillBuf buffer;

public void setup() {
}

public void eval() {

String stringValue = 
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input.start,
 input.end, input.buffer);

out.buffer = buffer; //If I return before this statement, a NPE is 
thrown :(
if(stringValue == null){
return;
}

int fieldValue = field.value;
if(fieldValue <= 0){
return; 
}

String delimiterValue = 
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(delimiter.start,
 delimiter.end, delimiter.buffer);
if(delimiterValue == null){
return;
}

String[] splittedInput = stringValue.split(delimiterValue);
if(splittedInput.length < fieldValue){
return;
}

// put the output value in the out buffer
String outputValue = splittedInput[fieldValue - 1];
out.start = 0;
out.end = outputValue.getBytes().length;
buffer.setBytes(0, outputValue.getBytes());
out.isSet = 1;
}

}
{code}

If I run the following query on the sample employees.json file (or actually a 
parquet, after modifying the table and columns names)

{code:title=SQL Query|borderStyle=solid}SELECT full_name, 
split_string(full_name, ' ', 4), split_string('Whatever', ' ', 4) FROM 
cp.employee.json LIMIT 1{code}

I get the following result
!https://i.stack.imgur.com/L8uQW.png!

Shouldn't I be getting NULLs for the last 2 columns ?

  was:
I defined the following UDF
{code:title=SplitPartFunc.java|borderStyle=solid}
import javax.inject.Inject;

import org.apache.drill.exec.expr.DrillSimpleFunc;
import org.apache.drill.exec.expr.annotations.FunctionTemplate;
import org.apache.drill.exec.expr.annotations.Output;
import org.apache.drill.exec.expr.annotations.Param;
import org.apache.drill.exec.expr.holders.IntHolder;
import org.apache.drill.exec.expr.holders.NullableVarCharHolder;
import org.apache.drill.exec.expr.holders.VarCharHolder;

import io.netty.buffer.DrillBuf;

@FunctionTemplate(name = "split_string", scope = 
FunctionTemplate.FunctionScope.SIMPLE, nulls = 
FunctionTemplate.NullHandling.NULL_IF_NULL)
public class SplitPartFunc implements DrillSimpleFunc {

@Param
VarCharHolder input;

@Param(constant = true)
VarCharHolder delimiter;

@Param(constant = true)
IntHolder field;

@Output
NullableVarCharHolder out;

@Inject
DrillBuf buffer;

public void setup() {
}

public void eval() {

String stringValue = 
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input.start,
 input.end, input.buffer);

out.buffer = buffer; //If I return before this statement, a NPE is 
thrown :(
if(stringValue == null){
return;
}

int fieldValue = field.value;
if(fieldValue <= 0){
return; 
}

String delimiterValue = 
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(delimiter.start,
 delimiter.end, delimiter.buffer);
if(delimiterValue == null){
return;
}

String[] splittedInput = stringValue.split(delimiterValue);
if(splittedInput.length < fieldValue){
return;
}

// put the output value in the out buffer
String outputValue = splittedInput[fieldValue - 1];
out.start = 0;
out.end = outputValue.getBytes().length;
buffer.setBytes(0, outputValue.getBytes());
out.isSet = 1;
}

}
{code}

If I run the following query on the sample employees.json file (or actually a 
parquet, after modifying the table and columns names)

{code:title=SQL Query|borderStyle=solid}SELECT full_name, 
split_string(full_name, 

[jira] [Closed] (DRILL-5194) UDF returns NULL as expected only if the input is a literal

2017-01-12 Thread Muhammad Gelbana (JIRA)

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

Muhammad Gelbana closed DRILL-5194.
---
Resolution: Duplicate

> UDF returns NULL as expected only if the input is a literal
> ---
>
> Key: DRILL-5194
> URL: https://issues.apache.org/jira/browse/DRILL-5194
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Functions - Drill
>Affects Versions: 1.9.0
>Reporter: Muhammad Gelbana
>
> I defined the following UDF
> {code:title=SplitPartFunc.java|borderStyle=solid}
> import javax.inject.Inject;
> import org.apache.drill.exec.expr.DrillSimpleFunc;
> import org.apache.drill.exec.expr.annotations.FunctionTemplate;
> import org.apache.drill.exec.expr.annotations.Output;
> import org.apache.drill.exec.expr.annotations.Param;
> import org.apache.drill.exec.expr.holders.IntHolder;
> import org.apache.drill.exec.expr.holders.NullableVarCharHolder;
> import org.apache.drill.exec.expr.holders.VarCharHolder;
> import io.netty.buffer.DrillBuf;
> @FunctionTemplate(name = "split_string", scope = 
> FunctionTemplate.FunctionScope.SIMPLE, nulls = 
> FunctionTemplate.NullHandling.NULL_IF_NULL)
> public class SplitPartFunc implements DrillSimpleFunc {
> @Param
> VarCharHolder input;
> @Param(constant = true)
> VarCharHolder delimiter;
> @Param(constant = true)
> IntHolder field;
> @Output
> NullableVarCharHolder out;
> @Inject
> DrillBuf buffer;
> public void setup() {
> }
> public void eval() {
> String stringValue = 
> org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input.start,
>  input.end, input.buffer);
> out.buffer = buffer; //If I return before this statement, a NPE is 
> thrown :(
> if(stringValue == null){
> return;
> }
> int fieldValue = field.value;
> if(fieldValue <= 0){
> return; 
> }
> String delimiterValue = 
> org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(delimiter.start,
>  delimiter.end, delimiter.buffer);
> if(delimiterValue == null){
> return;
> }
> String[] splittedInput = stringValue.split(delimiterValue);
> if(splittedInput.length < fieldValue){
> return;
> }
> // put the output value in the out buffer
> String outputValue = splittedInput[fieldValue - 1];
> out.start = 0;
> out.end = outputValue.getBytes().length;
> buffer.setBytes(0, outputValue.getBytes());
> out.isSet = 1;
> }
> }
> {code}
> If I run the following query on the sample employees.json file (or actually a 
> parquet, after modifying the table and columns names)
> {code:title=SQL Query|borderStyle=solid}SELECT full_name, 
> split_string(full_name, ' ', 4), split_string('Whatever', ' ', 4) FROM 
> cp.employee.json LIMIT 1{code}
> I get the following result
> !https://i.stack.imgur.com/L8uQW.png!
> Shouldn't I be getting the column value and null for the other 2 columns ?



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


[jira] [Created] (DRILL-5194) UDF returns NULL as expected only if the input is a literal

2017-01-12 Thread Muhammad Gelbana (JIRA)
Muhammad Gelbana created DRILL-5194:
---

 Summary: UDF returns NULL as expected only if the input is a 
literal
 Key: DRILL-5194
 URL: https://issues.apache.org/jira/browse/DRILL-5194
 Project: Apache Drill
  Issue Type: Bug
  Components: Functions - Drill
Affects Versions: 1.9.0
Reporter: Muhammad Gelbana


I defined the following UDF
{code:title=SplitPartFunc.java|borderStyle=solid}
import javax.inject.Inject;

import org.apache.drill.exec.expr.DrillSimpleFunc;
import org.apache.drill.exec.expr.annotations.FunctionTemplate;
import org.apache.drill.exec.expr.annotations.Output;
import org.apache.drill.exec.expr.annotations.Param;
import org.apache.drill.exec.expr.holders.IntHolder;
import org.apache.drill.exec.expr.holders.NullableVarCharHolder;
import org.apache.drill.exec.expr.holders.VarCharHolder;

import io.netty.buffer.DrillBuf;

@FunctionTemplate(name = "split_string", scope = 
FunctionTemplate.FunctionScope.SIMPLE, nulls = 
FunctionTemplate.NullHandling.NULL_IF_NULL)
public class SplitPartFunc implements DrillSimpleFunc {

@Param
VarCharHolder input;

@Param(constant = true)
VarCharHolder delimiter;

@Param(constant = true)
IntHolder field;

@Output
NullableVarCharHolder out;

@Inject
DrillBuf buffer;

public void setup() {
}

public void eval() {

String stringValue = 
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input.start,
 input.end, input.buffer);

out.buffer = buffer; //If I return before this statement, a NPE is 
thrown :(
if(stringValue == null){
return;
}

int fieldValue = field.value;
if(fieldValue <= 0){
return; 
}

String delimiterValue = 
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(delimiter.start,
 delimiter.end, delimiter.buffer);
if(delimiterValue == null){
return;
}

String[] splittedInput = stringValue.split(delimiterValue);
if(splittedInput.length < fieldValue){
return;
}

// put the output value in the out buffer
String outputValue = splittedInput[fieldValue - 1];
out.start = 0;
out.end = outputValue.getBytes().length;
buffer.setBytes(0, outputValue.getBytes());
out.isSet = 1;
}

}
{code}

If I run the following query on the sample employees.json file (or actually a 
parquet, after modifying the table and columns names)

{code:title=SQL Query|borderStyle=solid}SELECT full_name, 
split_string(full_name, ' ', 4), split_string('Whatever', ' ', 4) FROM 
cp.employee.json LIMIT 1{code}

I get the following result
!https://i.stack.imgur.com/L8uQW.png!

Shouldn't I be getting the column value and null for the other 2 columns ?



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


[jira] [Created] (DRILL-5193) UDF returns NULL as expected only if the input is a literal

2017-01-12 Thread Muhammad Gelbana (JIRA)
Muhammad Gelbana created DRILL-5193:
---

 Summary: UDF returns NULL as expected only if the input is a 
literal
 Key: DRILL-5193
 URL: https://issues.apache.org/jira/browse/DRILL-5193
 Project: Apache Drill
  Issue Type: Bug
  Components: Functions - Drill
Affects Versions: 1.9.0
Reporter: Muhammad Gelbana


I defined the following UDF
{code:title=SplitPartFunc.java|borderStyle=solid}
import javax.inject.Inject;

import org.apache.drill.exec.expr.DrillSimpleFunc;
import org.apache.drill.exec.expr.annotations.FunctionTemplate;
import org.apache.drill.exec.expr.annotations.Output;
import org.apache.drill.exec.expr.annotations.Param;
import org.apache.drill.exec.expr.holders.IntHolder;
import org.apache.drill.exec.expr.holders.NullableVarCharHolder;
import org.apache.drill.exec.expr.holders.VarCharHolder;

import io.netty.buffer.DrillBuf;

@FunctionTemplate(name = "split_string", scope = 
FunctionTemplate.FunctionScope.SIMPLE, nulls = 
FunctionTemplate.NullHandling.NULL_IF_NULL)
public class SplitPartFunc implements DrillSimpleFunc {

@Param
VarCharHolder input;

@Param(constant = true)
VarCharHolder delimiter;

@Param(constant = true)
IntHolder field;

@Output
NullableVarCharHolder out;

@Inject
DrillBuf buffer;

public void setup() {
}

public void eval() {

String stringValue = 
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input.start,
 input.end, input.buffer);

out.buffer = buffer; //If I return before this statement, a NPE is 
thrown :(
if(stringValue == null){
return;
}

int fieldValue = field.value;
if(fieldValue <= 0){
return; 
}

String delimiterValue = 
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(delimiter.start,
 delimiter.end, delimiter.buffer);
if(delimiterValue == null){
return;
}

String[] splittedInput = stringValue.split(delimiterValue);
if(splittedInput.length < fieldValue){
return;
}

// put the output value in the out buffer
String outputValue = splittedInput[fieldValue - 1];
out.start = 0;
out.end = outputValue.getBytes().length;
buffer.setBytes(0, outputValue.getBytes());
out.isSet = 1;
}

}
{code}

If I run the following query on the sample employees.json file (or actually a 
parquet, after modifying the table and columns names)

{code:title=SQL Query|borderStyle=solid}SELECT full_name, 
split_string(full_name, ' ', 4), split_string('Whatever', ' ', 4) FROM 
cp.employee.json LIMIT 1{code}

I get the following result
!https://i.stack.imgur.com/L8uQW.png!

Shouldn't I be getting the column value and null for the other 2 columns ?



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


[jira] [Commented] (DRILL-4919) Fix select count(1) / count(*) on csv with header

2017-01-12 Thread ASF GitHub Bot (JIRA)

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

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

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/714#discussion_r95770127
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/text/compliant/CompliantTextRecordReader.java
 ---
@@ -91,6 +96,9 @@ public boolean apply(@Nullable SchemaPath path) {
 
   @Override
   protected List getDefaultColumnsToRead() {
+if (settings.isHeaderExtractionEnabled()) {
--- End diff --

Added.


> Fix select count(1) / count(*) on csv with header
> -
>
> Key: DRILL-4919
> URL: https://issues.apache.org/jira/browse/DRILL-4919
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Functions - Drill
>Affects Versions: 1.8.0
>Reporter: F Méthot
>Assignee: Arina Ielchiieva
>Priority: Minor
> Fix For: Future
>
>
> This happens since  1.8
> Dataset (I used extended char for display purpose) test.csvh:
> a,b,c,d\n
> 1,2,3,4\n
> 5,6,7,8\n
> Storage config:
> "csvh": {
>   "type": "text",
>   "extensions" : [
>   "csvh"
>],
>"extractHeader": true,
>"delimiter": ","
>   }
> select count(1) from dfs.`test.csvh`
> Error: UNSUPPORTED_OPERATION ERROR: With extractHeader enabled, only header 
> names are supported
> coumn name columns
> column index
> Fragment 0:0



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


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-12 Thread ASF GitHub Bot (JIRA)

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

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

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/721#discussion_r95764299
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -105,6 +128,17 @@ public String getTime() {
   return format.format(time);
 }
 
+public long getStartTime() {
+  return startTime;
+}
+
+public long getEndTime() {
+  return endTime;
+}
+
+public String getDuration() {
+  return getPrettyDuration(startTime,endTime);
--- End diff --

Please add space between parameters -> `startTime, endTime`


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



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


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-12 Thread ASF GitHub Bot (JIRA)

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

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

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/721#discussion_r95764142
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileWrapper.java
 ---
@@ -114,6 +114,10 @@ public QueryProfile getProfile() {
 return profile;
   }
 
+  public String getProfileDuration() {
+return 
ProfileResources.getPrettyDuration(profile.getStart(),profile.getEnd());
--- End diff --

Please add space between parameters -> `profile.getStart(), 
profile.getEnd()`


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



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


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-12 Thread ASF GitHub Bot (JIRA)

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

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

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/721#discussion_r95764706
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -68,20 +68,43 @@
   @Inject DrillUserPrincipal principal;
   @Inject SecurityContext sc;
 
+  /**
+   * Returns elapsed time a human-readable format. If end time is less 
than the start time, current epoch time is assumed as the end time.
+   * e.g. getPrettyDuration(1468368841695,1468394096016) = '7 hr 00 min 
54.321 sec'
+   * @param startTimeMillis Start Time in milliseconds
+   * @param endTimeMillis   End Time in milliseconds
+   * @returnHuman-Readable Elapsed Time
+   */
+  public static String getPrettyDuration(long startTimeMillis, long 
endTimeMillis) {
+long durationInMillis = ( startTimeMillis > endTimeMillis ? 
System.currentTimeMillis() : endTimeMillis ) - startTimeMillis;
--- End diff --

Please remove space after -> `(startTimeMillis` and before -> 
`endTimeMillis)` parenthesis.


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



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


[jira] [Commented] (DRILL-5088) Error when reading DBRef column

2017-01-12 Thread ASF GitHub Bot (JIRA)

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

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

Github user chunhui-shi commented on the issue:

https://github.com/apache/drill/pull/702
  
MongoGroupScan tries to read first record to guess record width. So this 
toJson is called for only first record.

Notice that MongoClient.getDefaultCodecRegistry() contains 
DBRefCodecProvider:

Shown in MongoClient.java(In MongoClient.java):

private static final CodecRegistry DEFAULT_CODEC_REGISTRY =
fromProviders(asList(new ValueCodecProvider(),
new DBRefCodecProvider(),
new DocumentCodecProvider(new 
DocumentToDBRefTransformer()),
new DBObjectCodecProvider(),
new BsonValueCodecProvider(),
new GeoJsonCodecProvider()));

but a default DocumentCodec constructor does not. And it was this 
constructor get called if we don't set a codec for toJson function to use. The 
list of CodecProviders is shown in DocumentCodec.java in MongoDb's code:

public class DocumentCodec implements CollectibleCodec {

private static final String ID_FIELD_NAME = "_id";
private static final CodecRegistry DEFAULT_REGISTRY = 
fromProviders(asList(new ValueCodecProvider(),
new BsonValueCodecProvider(),
new DocumentCodecProvider()));



> Error when reading DBRef column
> ---
>
> Key: DRILL-5088
> URL: https://issues.apache.org/jira/browse/DRILL-5088
> Project: Apache Drill
>  Issue Type: Bug
>  Components: Execution - Data Types
> Environment: drill 1.9.0
> mongo 3.2
>Reporter: Guillaume Champion
>Assignee: Chunhui Shi
>
> In a mongo database with DBRef, when a DBRef is inserted in the first line of 
> a mongo's collection drill query failed :
> {code}
> 0: jdbc:drill:zk=local> select * from mongo.mydb.contact2;
> Error: SYSTEM ERROR: CodecConfigurationException: Can't find a codec for 
> class com.mongodb.DBRef.
> {code}
> Simple example to reproduce:
> In mongo instance
> {code}
> db.contact2.drop();
> db.contact2.insert({ "_id" : ObjectId("582081d96b69060001fd8938"), "account" 
> : DBRef("contact", ObjectId("999cbf116b69060001fd8611")) });
> {code}
> In drill :
> {code}
> 0: jdbc:drill:zk=local> select * from mongo.mydb.contact2;
> Error: SYSTEM ERROR: CodecConfigurationException: Can't find a codec for 
> class com.mongodb.DBRef.
> [Error Id: 2944d766-e483-4453-a706-3d481397b186 on Analytics-Biznet:31010] 
> (state=,code=0)
> {code}
> If the first line doesn't contain de DBRef, drill will querying correctly :
> In a mongo instance :
> {code}
> db.contact2.drop();
> db.contact2.insert({ "_id" : ObjectId("582081d96b69060001fd8939") });
> db.contact2.insert({ "_id" : ObjectId("582081d96b69060001fd8938"), "account" 
> : DBRef("contact", ObjectId("999cbf116b69060001fd8611")) });
> {code}
> In drill :
> {code}
> 0: jdbc:drill:zk=local> select * from mongo.mydb.contact2;
> +--+---+
> | _id  |account   
>  |
> +--+---+
> | {"$oid":"582081d96b69060001fd8939"}  | {"$id":{}}   
>  |
> | {"$oid":"582081d96b69060001fd8938"}  | 
> {"$ref":"contact","$id":{"$oid":"999cbf116b69060001fd8611"}}  |
> +--+---+
> 2 rows selected (0,563 seconds)
> {code}



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