You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by sm...@apache.org on 2014/11/25 07:42:18 UTC
[1/4] incubator-drill git commit: DRILL-1185: Drill not picking up
'text' files from classpath
Repository: incubator-drill
Updated Branches:
refs/heads/master 0a28365a2 -> 774a1f04c
DRILL-1185: Drill not picking up 'text' files from classpath
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/3193bd41
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/3193bd41
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/3193bd41
Branch: refs/heads/master
Commit: 3193bd41449f9bc10fadd4ef591e1f57fba19cc3
Parents: 23ee652
Author: Hsuan-Yi Chu <hs...@usc.edu>
Authored: Mon Nov 17 17:09:00 2014 -0800
Committer: Steven Phillips <sp...@maprtech.com>
Committed: Mon Nov 24 19:26:21 2014 -0800
----------------------------------------------------------------------
.../main/java/org/apache/drill/exec/store/ClassPathFileSystem.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3193bd41/exec/java-exec/src/main/java/org/apache/drill/exec/store/ClassPathFileSystem.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/ClassPathFileSystem.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/ClassPathFileSystem.java
index d5c92f5..cab5339 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/ClassPathFileSystem.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/ClassPathFileSystem.java
@@ -62,7 +62,7 @@ public class ClassPathFileSystem extends FileSystem{
}
private String getFileName(Path path){
- String file = path.toString();
+ String file = path.toUri().getPath();
if(file.charAt(0) == '/'){
file = file.substring(1);
}
[2/4] incubator-drill git commit: DRILL-985: Referencing a view via
its filename
Posted by sm...@apache.org.
DRILL-985: Referencing a view via its filename
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/23ee6522
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/23ee6522
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/23ee6522
Branch: refs/heads/master
Commit: 23ee6522881ffabb53a9bb48e946bcbefe534a5c
Parents: 0a28365
Author: Hsuan-Yi Chu <hs...@usc.edu>
Authored: Tue Nov 4 14:27:28 2014 -0800
Committer: Steven Phillips <sp...@maprtech.com>
Committed: Mon Nov 24 19:26:21 2014 -0800
----------------------------------------------------------------------
.../java/org/apache/drill/exec/dotdrill/DotDrillUtil.java | 10 ++++++----
.../test/java/org/apache/drill/TestExampleQueries.java | 8 ++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/23ee6522/exec/java-exec/src/main/java/org/apache/drill/exec/dotdrill/DotDrillUtil.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/dotdrill/DotDrillUtil.java b/exec/java-exec/src/main/java/org/apache/drill/exec/dotdrill/DotDrillUtil.java
index ea60fae..63b22e9 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/dotdrill/DotDrillUtil.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/dotdrill/DotDrillUtil.java
@@ -53,9 +53,11 @@ public class DotDrillUtil {
return getDrillFiles(fs, fs.getUnderlying().globStatus(new Path(root, "*.drill")), types);
}
- public static List<DotDrillFile> getDotDrills(DrillFileSystem fs, Path root, String name, DotDrillType... types) throws IOException{
- return getDrillFiles(fs, fs.getUnderlying().globStatus(new Path(root, name + DotDrillType.DOT_DRILL_GLOB)), types);
- }
-
+ public static List<DotDrillFile> getDotDrills(DrillFileSystem fs, Path root, String name, DotDrillType... types) throws IOException{
+ if(!name.endsWith(".drill")) {
+ name = name + DotDrillType.DOT_DRILL_GLOB;
+ }
+ return getDrillFiles(fs, fs.getUnderlying().globStatus(new Path(root, name)), types);
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/23ee6522/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
index bb411e7..b9d9a27 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
@@ -27,6 +27,14 @@ import org.junit.Test;
public class TestExampleQueries extends BaseTestQuery{
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(TestExampleQueries.class);
+ @Test // see DRILL-985
+ public void testViewFileName() throws Exception {
+ test("use dfs.tmp");
+ test("create view nation_view as select * from cp.`tpch/nation.parquet`;");
+ test("select * from dfs.tmp.`nation_view.view.drill`");
+ test("drop view nation_view");
+ }
+
@Test
public void testParquetComplex() throws Exception {
test("select recipe from cp.`parquet/complex.parquet`");
[4/4] incubator-drill git commit: DRILL-1404: Queries with empty
results are throwing "HTTP ERROR 500" from Web UI
Posted by sm...@apache.org.
DRILL-1404: Queries with empty results are throwing "HTTP ERROR 500" from Web UI
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/774a1f04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/774a1f04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/774a1f04
Branch: refs/heads/master
Commit: 774a1f04cd234a318cd25bd242ecface75a2df08
Parents: bbf9bc3
Author: Hsuan-Yi Chu <hs...@usc.edu>
Authored: Thu Nov 13 15:52:31 2014 -0800
Committer: Steven Phillips <sp...@maprtech.com>
Committed: Mon Nov 24 19:26:22 2014 -0800
----------------------------------------------------------------------
.../drill/exec/server/rest/QueryResources.java | 22 +++++++++++++--
.../drill/exec/server/rest/QueryWrapper.java | 28 +++++++++++++++++---
2 files changed, 45 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/774a1f04/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java
index bea693c..ba59d8f 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java
@@ -70,14 +70,32 @@ public class QueryResources {
List<String> columnNames = new ArrayList<>(result.get(0).keySet());
List<List<Object>> records = new ArrayList<>();
- for(Map m : result) {
- records.add(new ArrayList<Object>(m.values()));
+
+ if(!isEmptyResult(result)) {
+ for (Map m : result) {
+ records.add(new ArrayList<Object>(m.values()));
+ }
}
+
Table table = new Table(columnNames, records);
return new Viewable("/rest/query/result.ftl", table);
}
+ private boolean isEmptyResult(List<Map<String, Object>> result) {
+ if (result.size() > 1) {
+ return false;
+ } else {
+ for(Object col : result.get(0).values()) {
+ if(col != null) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+
public class Table {
private List<String> columnNames;
private List<List<Object>> records;
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/774a1f04/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
index f03bfe6..922533a 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
@@ -35,6 +35,7 @@ import org.apache.drill.exec.exception.SchemaChangeException;
import org.apache.drill.exec.memory.BufferAllocator;
import org.apache.drill.exec.physical.impl.flatten.FlattenRecordBatch;
import org.apache.drill.exec.proto.UserBitShared;
+import org.apache.drill.exec.record.MaterializedField;
import org.apache.drill.exec.record.RecordBatchLoader;
import org.apache.drill.exec.record.VectorWrapper;
import org.apache.drill.exec.rpc.RpcException;
@@ -42,6 +43,7 @@ import org.apache.drill.exec.rpc.user.ConnectionThrottle;
import org.apache.drill.exec.rpc.user.QueryResultBatch;
import org.apache.drill.exec.rpc.user.UserResultsListener;
import org.apache.drill.exec.vector.ValueVector;
+import org.apache.drill.exec.proto.UserBitShared.SerializedField;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -87,6 +89,14 @@ public class QueryWrapper {
client.runQuery(getType(), query, listener);
List<Map<String, Object>> result = listener.waitForCompletion();
+ if (result.isEmpty()) {
+ Map<String, Object> dumbRecord = new HashMap<>();
+ for (String columnName : listener.getColumnNames()) {
+ dumbRecord.put(columnName, null);
+ }
+ result.add(dumbRecord);
+ }
+
return result;
}
}
@@ -120,12 +130,12 @@ public class QueryWrapper {
@Override
public void resultArrived(QueryResultBatch result, ConnectionThrottle throttle) {
int rows = result.getHeader().getRowCount();
- if (result.getData() != null) {
+ if (result.hasData()) {
count.addAndGet(rows);
try {
loader.load(result.getHeader().getDef(), result.getData());
- if (!schemaAdded) {
- columnNames = new ArrayList<>();
+ if (!schemaAdded || output.isEmpty()) {
+ columnNames = new ArrayList<>();
for (int i = 0; i < loader.getSchema().getFieldCount(); ++i) {
columnNames.add(loader.getSchema().getColumn(i).getPath().getAsUnescapedPath());
}
@@ -152,7 +162,15 @@ public class QueryWrapper {
}
output.add(record);
}
+ } else if (!schemaAdded) {
+ columnNames = new ArrayList<>();
+ schemaAdded = true;
+ for (SerializedField fmd : result.getHeader().getDef().getFieldList()) {
+ MaterializedField fieldDef = MaterializedField.create(fmd);
+ columnNames.add(fieldDef.getPath().getAsUnescapedPath());
+ }
}
+
result.release();
if (result.getHeader().getIsLastChunk()) {
latch.countDown();
@@ -170,5 +188,9 @@ public class QueryWrapper {
}
return output;
}
+
+ public List<String> getColumnNames() {
+ return new ArrayList<String> (columnNames);
+ }
}
}
[3/4] incubator-drill git commit: DRILL-1376 ORDER BY clause ignored
in query run through web UI - Bug fixed
Posted by sm...@apache.org.
DRILL-1376 ORDER BY clause ignored in query run through web UI - Bug fixed
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/bbf9bc31
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/bbf9bc31
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/bbf9bc31
Branch: refs/heads/master
Commit: bbf9bc312e9426c6d0f7f08b37878fcc5808382e
Parents: 3193bd4
Author: Hsuan-Yi Chu <hs...@usc.edu>
Authored: Wed Nov 12 16:48:41 2014 -0800
Committer: Steven Phillips <sp...@maprtech.com>
Committed: Mon Nov 24 19:26:22 2014 -0800
----------------------------------------------------------------------
exec/java-exec/src/main/resources/rest/query/result.ftl | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/bbf9bc31/exec/java-exec/src/main/resources/rest/query/result.ftl
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/resources/rest/query/result.ftl b/exec/java-exec/src/main/resources/rest/query/result.ftl
index d4e3508..e615bc5 100644
--- a/exec/java-exec/src/main/resources/rest/query/result.ftl
+++ b/exec/java-exec/src/main/resources/rest/query/result.ftl
@@ -48,6 +48,7 @@
<script charset="utf-8">
$(document).ready(function() {
$('#result').dataTable( {
+ "aaSorting": [],
"scrollX" : true,
"dom": '<"H"lCfr>t<"F"ip>',
"jQueryUI" : true