You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by pa...@apache.org on 2015/02/18 06:30:13 UTC

[1/3] drill git commit: DRILL-1219. C++ Client. Fix timeout for 32-bit windows platform

Repository: drill
Updated Branches:
  refs/heads/master 36fc560f0 -> 30c09ec48


DRILL-1219. C++ Client. Fix timeout for 32-bit windows platform


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/ab4d7998
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/ab4d7998
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/ab4d7998

Branch: refs/heads/master
Commit: ab4d799807bdcf6ecb74c6c0ffd655d6a1a965ad
Parents: 36fc560
Author: alzarei <az...@ece.ubc.ca>
Authored: Mon Feb 16 14:41:28 2015 -0800
Committer: Parth Chandra <pc...@maprtech.com>
Committed: Tue Feb 17 16:15:33 2015 -0800

----------------------------------------------------------------------
 .../native/client/src/clientlib/drillClientImpl.cpp    | 11 +++++++++++
 .../native/client/src/clientlib/drillClientImpl.hpp    | 13 ++++++-------
 contrib/native/client/src/include/drill/common.hpp     |  8 ++++++++
 3 files changed, 25 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/ab4d7998/contrib/native/client/src/clientlib/drillClientImpl.cpp
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/clientlib/drillClientImpl.cpp b/contrib/native/client/src/clientlib/drillClientImpl.cpp
index f9c17f9..ea3a7ee 100644
--- a/contrib/native/client/src/clientlib/drillClientImpl.cpp
+++ b/contrib/native/client/src/clientlib/drillClientImpl.cpp
@@ -196,6 +196,12 @@ connectionStatus_t DrillClientImpl::recvHandshake(){
     if(m_rbuf!=NULL){
         Utils::freeBuffer(m_rbuf, MAX_SOCK_RD_BUFSIZE); m_rbuf=NULL;
     }
+#ifdef WIN32_SHUTDOWN_ON_TIMEOUT
+    if (m_pError != NULL) {
+        return static_cast<connectionStatus_t>(m_pError->status);
+    }
+#endif // WIN32_SHUTDOWN_ON_TIMEOUT
+
     return CONN_SUCCESS;
 }
 
@@ -731,7 +737,12 @@ void DrillClientImpl::handleReadTimeout(const boost::system::error_code & err){
             // to have the BOOST_ASIO_ENABLE_CANCELIO macro (as well as the BOOST_ASIO_DISABLE_IOCP macro?)
             // defined. To be really sure, we need to close the socket. Closing the socket is a bit
             // drastic and we will defer that till a later release.
+#ifdef WIN32_SHUTDOWN_ON_TIMEOUT
+            boost::system::error_code ignorederr;
+            m_socket.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ignorederr);
+#else // NOT WIN32_SHUTDOWN_ON_TIMEOUT
             m_socket.cancel();
+#endif // WIN32_SHUTDOWN_ON_TIMEOUT
         }
     }
     return;

http://git-wip-us.apache.org/repos/asf/drill/blob/ab4d7998/contrib/native/client/src/clientlib/drillClientImpl.hpp
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/clientlib/drillClientImpl.hpp b/contrib/native/client/src/clientlib/drillClientImpl.hpp
index c87e1b7..d287bfc 100644
--- a/contrib/native/client/src/clientlib/drillClientImpl.hpp
+++ b/contrib/native/client/src/clientlib/drillClientImpl.hpp
@@ -20,15 +20,14 @@
 #ifndef DRILL_CLIENT_IMPL_H
 #define DRILL_CLIENT_IMPL_H
 
-/* Define some BOOST defines */
+#include "drill/common.hpp"
+
+// Define some BOOST defines
+// WIN32_SHUTDOWN_ON_TIMEOUT is defined in "drill/common.hpp" for Windows 32 bit platform
+#ifndef WIN32_SHUTDOWN_ON_TIMEOUT
 #define BOOST_ASIO_ENABLE_CANCELIO
-// If we want to support older versions of windows than Windows 7, we should
-// disable IOCP
-//#ifdef _WIN32
-//#define BOOST_ASIO_DISABLE_IOCP
-//#endif // _WIN32
+#endif //WIN32_SHUTDOWN_ON_TIMEOUT
 
-#include "drill/common.hpp"
 #include <stdlib.h>
 #include <time.h>
 #include <queue>

http://git-wip-us.apache.org/repos/asf/drill/blob/ab4d7998/contrib/native/client/src/include/drill/common.hpp
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/include/drill/common.hpp b/contrib/native/client/src/include/drill/common.hpp
index 824d670..e149ed1 100644
--- a/contrib/native/client/src/include/drill/common.hpp
+++ b/contrib/native/client/src/include/drill/common.hpp
@@ -50,6 +50,14 @@
 #define CODER_DEBUGGING
 #endif
 
+// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/basic_stream_socket/cancel/overload1.html
+// : "Calls to cancel() will always fail with boost::asio::error::operation_not_supported when run on Windows XP, Windows Server 2003, and earlier versions of Windows..."
+// As such, achieving cancel needs to be implemented differently;
+#if defined(_WIN32)  && !defined(_WIN64)
+#define WIN32_SHUTDOWN_ON_TIMEOUT
+#endif // _WIN32 && !_WIN64
+
+
 namespace Drill {
 
 typedef std::vector<uint8_t> DataBuf;


[2/3] drill git commit: DRILL-2254: use parent field while adding a child vector into a repeated list

Posted by pa...@apache.org.
DRILL-2254: use parent field while adding a child vector into a repeated list


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/d2831ba7
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/d2831ba7
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/d2831ba7

Branch: refs/heads/master
Commit: d2831ba7aa3caebae99f4571d683b5ee5ba44148
Parents: ab4d799
Author: Hanifi Gunes <hg...@maprtech.com>
Authored: Tue Feb 17 12:20:01 2015 -0800
Committer: Parth Chandra <pc...@maprtech.com>
Committed: Tue Feb 17 17:04:23 2015 -0800

----------------------------------------------------------------------
 .../exec/vector/complex/RepeatedListVector.java |  2 +-
 .../exec/physical/impl/flatten/TestFlatten.java | 39 ++++++++++++++++++++
 .../flatten/drill-2254-result-mix.json          |  9 +++++
 .../flatten/drill-2254-result-multi.json        |  3 ++
 .../flatten/drill-2254-result-single.json       |  3 ++
 5 files changed, 55 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/d2831ba7/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
index d09dc55..131f2a3 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
@@ -388,7 +388,7 @@ public class RepeatedListVector extends AbstractContainerVector implements Repea
     Preconditions.checkArgument(name == null);
 
     if(vector == null){
-      final MaterializedField child =  MaterializedField.create(SchemaPath.getSimplePath("").getUnindexedArrayChild(), type);
+      final MaterializedField child =  MaterializedField.create(getField().getPath().getUnindexedArrayChild(), type);
       vector = TypeHelper.getNewVector(child, allocator, callBack);
       setVector(vector);
       if (callBack != null) {

http://git-wip-us.apache.org/repos/asf/drill/blob/d2831ba7/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/flatten/TestFlatten.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/flatten/TestFlatten.java b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/flatten/TestFlatten.java
index f9eb2c2..b56df84 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/flatten/TestFlatten.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/flatten/TestFlatten.java
@@ -20,6 +20,7 @@ package org.apache.drill.exec.physical.impl.flatten;
 import static org.junit.Assert.assertEquals;
 
 import org.apache.drill.BaseTestQuery;
+import org.apache.drill.exec.proto.UserBitShared;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -202,4 +203,42 @@ public class TestFlatten extends BaseTestQuery {
     test("select flatten(sub.fk.`value`) from (select flatten(kvgen(map)) fk from cp.`/store/json/nested_repeated_map.json`) sub");
   }
 
+
+  @Test //DRILL-2254
+  public void testSingleFlattenFromNestedRepeatedList() throws Exception {
+    final String query = "select t.uid, flatten(t.odd) odd from cp.`project/complex/a.json` t";
+
+    testBuilder()
+        .sqlQuery(query)
+        .unOrdered()
+        .jsonBaselineFile("flatten/drill-2254-result-single.json")
+        .build()
+        .run();
+  }
+
+  @Test //DRILL-2254 supplementary
+  public void testMultiFlattenFromNestedRepeatedList() throws Exception {
+    final String query = "select t.uid, flatten(flatten(t.odd)) odd from cp.`project/complex/a.json` t";
+
+    testBuilder()
+        .sqlQuery(query)
+        .unOrdered()
+        .jsonBaselineFile("flatten/drill-2254-result-multi.json")
+        .build()
+        .run();
+  }
+
+  @Test //DRILL-2254 supplementary
+  public void testSingleMultiFlattenFromNestedRepeatedList() throws Exception {
+    final String query = "select t.uid, flatten(t.odd) once, flatten(flatten(t.odd)) twice from cp.`project/complex/a.json` t";
+
+    testBuilder()
+        .sqlQuery(query)
+        .unOrdered()
+        .jsonBaselineFile("flatten/drill-2254-result-mix.json")
+        .build()
+        .run();
+  }
+
+
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/d2831ba7/exec/java-exec/src/test/resources/flatten/drill-2254-result-mix.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/flatten/drill-2254-result-mix.json b/exec/java-exec/src/test/resources/flatten/drill-2254-result-mix.json
new file mode 100644
index 0000000..8c4d481
--- /dev/null
+++ b/exec/java-exec/src/test/resources/flatten/drill-2254-result-mix.json
@@ -0,0 +1,9 @@
+{"uid": 1, "once": [1], "twice": 1}
+{"uid": 1, "once": [1], "twice": 3}
+{"uid": 1, "once": [1], "twice": 5}
+{"uid": 1, "once": [3], "twice": 1}
+{"uid": 1, "once": [3], "twice": 3}
+{"uid": 1, "once": [3], "twice": 5}
+{"uid": 1, "once": [5], "twice": 1}
+{"uid": 1, "once": [5], "twice": 3}
+{"uid": 1, "once": [5], "twice": 5}

http://git-wip-us.apache.org/repos/asf/drill/blob/d2831ba7/exec/java-exec/src/test/resources/flatten/drill-2254-result-multi.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/flatten/drill-2254-result-multi.json b/exec/java-exec/src/test/resources/flatten/drill-2254-result-multi.json
new file mode 100644
index 0000000..b04375a
--- /dev/null
+++ b/exec/java-exec/src/test/resources/flatten/drill-2254-result-multi.json
@@ -0,0 +1,3 @@
+{"uid": 1, "odd": 1}
+{"uid": 1, "odd": 3}
+{"uid": 1, "odd": 5}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/drill/blob/d2831ba7/exec/java-exec/src/test/resources/flatten/drill-2254-result-single.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/flatten/drill-2254-result-single.json b/exec/java-exec/src/test/resources/flatten/drill-2254-result-single.json
new file mode 100644
index 0000000..ffd748f
--- /dev/null
+++ b/exec/java-exec/src/test/resources/flatten/drill-2254-result-single.json
@@ -0,0 +1,3 @@
+{"uid": 1, "odd": [1]}
+{"uid": 1, "odd": [3]}
+{"uid": 1, "odd": [5]}
\ No newline at end of file


[3/3] drill git commit: DRILL-2169: disable embedded server for tests when not needed

Posted by pa...@apache.org.
DRILL-2169: disable embedded server for tests when not needed


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/30c09ec4
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/30c09ec4
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/30c09ec4

Branch: refs/heads/master
Commit: 30c09ec48a3fa51af3015a6ba5dc3c9b51b63044
Parents: d2831ba
Author: Hanifi Gunes <hg...@maprtech.com>
Authored: Wed Feb 4 19:05:47 2015 -0800
Committer: Parth Chandra <pc...@maprtech.com>
Committed: Tue Feb 17 21:29:53 2015 -0800

----------------------------------------------------------------------
 exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/30c09ec4/exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java b/exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java
index 17bcb79..cf99577 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java
@@ -49,6 +49,7 @@ import org.apache.drill.exec.server.RemoteServiceSet;
 import org.apache.drill.exec.util.VectorUtil;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.rules.TestRule;
 import org.junit.rules.TestWatcher;
 import org.junit.runner.Description;
@@ -67,6 +68,7 @@ public class BaseTestQuery extends ExecTest{
   private static final Properties TEST_CONFIGURATIONS = new Properties() {
     {
       put(ExecConstants.SYS_STORE_PROVIDER_LOCAL_ENABLE_WRITE, "false");
+      put(ExecConstants.HTTP_ENABLE, "false");
     }
   };