carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenliang...@apache.org
Subject carbondata git commit: [CARBONDATA-1686] Presto Version Upgrade to 0.186
Date Sat, 11 Nov 2017 00:41:29 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 933e30ccc -> ccb65603e


[CARBONDATA-1686] Presto Version Upgrade to 0.186

This closes #1477


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

Branch: refs/heads/master
Commit: ccb65603e611a15331b2cd0f1eef9e0ffd129b4c
Parents: 933e30c
Author: Bhavya <bhavya@knoldus.com>
Authored: Thu Nov 9 12:55:50 2017 +0530
Committer: chenliang613 <chenliang613@huawei.com>
Committed: Sat Nov 11 08:41:18 2017 +0800

----------------------------------------------------------------------
 integration/presto/pom.xml                      | 41 +++++++++++++-----
 .../presto/CarbondataColumnConstraint.java      |  3 +-
 .../presto/CarbondataColumnHandle.java          |  3 +-
 .../carbondata/presto/CarbondataConnector.java  |  2 +-
 .../carbondata/presto/CarbondataPageSource.java |  4 --
 .../presto/CarbondataRecordCursor.java          |  5 ---
 .../presto/CarbondataTableLayoutHandle.java     |  3 +-
 .../presto/CarbondataTransactionHandle.java     | 44 +++++++++++++++++++-
 .../readers/DecimalSliceStreamReader.java       |  6 +--
 .../carbondata/presto/server/PrestoServer.scala | 10 ++---
 10 files changed, 84 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/ccb65603/integration/presto/pom.xml
----------------------------------------------------------------------
diff --git a/integration/presto/pom.xml b/integration/presto/pom.xml
index 13d351d..5179284 100644
--- a/integration/presto/pom.xml
+++ b/integration/presto/pom.xml
@@ -31,7 +31,7 @@
   <packaging>presto-plugin</packaging>
 
   <properties>
-    <presto.version>0.166</presto.version>
+    <presto.version>0.186</presto.version>
     <dev.path>${basedir}/../../dev</dev.path>
   </properties>
 
@@ -143,7 +143,6 @@
           <groupId>io.dropwizard.metrics</groupId>
           <artifactId>metrics-graphite</artifactId>
         </exclusion>
-
         <exclusion>
           <groupId>com.google.code.findbugs</groupId>
           <artifactId>jsr305</artifactId>
@@ -413,7 +412,7 @@
     <dependency>
       <groupId>io.airlift</groupId>
       <artifactId>slice</artifactId>
-      <version>0.27</version>
+      <version>0.31</version>
       <scope>provided</scope>
       <exclusions>
         <exclusion>
@@ -441,6 +440,34 @@
       <scope>test</scope>
       <version>2.1.0</version>
     </dependency>
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>jsr305</artifactId>
+      <version>3.0.2</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>jsr305</artifactId>
+      <version>3.0.2</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.glassfish.hk2</groupId>
+      <artifactId>hk2-api</artifactId>
+      <version>2.5.0-b42</version>
+    </dependency>
+    <dependency>
+      <groupId>org.glassfish.hk2</groupId>
+      <artifactId>hk2-locator</artifactId>
+      <version>2.5.0-b42</version>
+    </dependency>
+    <dependency>
+      <groupId>org.glassfish.hk2</groupId>
+      <artifactId>hk2-utils</artifactId>
+      <version>2.5.0-b42</version>
+    </dependency>
+
   </dependencies>
 
   <build>
@@ -517,14 +544,6 @@
         </executions>
       </plugin>
       <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.8</source>
-          <target>1.8</target>
-        </configuration>
-      </plugin>
-
-      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>1.4.1</version>

http://git-wip-us.apache.org/repos/asf/carbondata/blob/ccb65603/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataColumnConstraint.java
----------------------------------------------------------------------
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataColumnConstraint.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataColumnConstraint.java
index 82c7c78..020e7b2 100755
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataColumnConstraint.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataColumnConstraint.java
@@ -25,8 +25,7 @@ import com.fasterxml.jackson.annotation.JsonSetter;
 import java.util.Objects;
 import java.util.Optional;
 
-//import static com.google.common.base.MoreObjects.toStringHelper;
-import static com.google.common.base.Objects.toStringHelper;
+import static com.google.common.base.MoreObjects.toStringHelper;
 import static java.util.Objects.requireNonNull;
 
 /**

http://git-wip-us.apache.org/repos/asf/carbondata/blob/ccb65603/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataColumnHandle.java
----------------------------------------------------------------------
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataColumnHandle.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataColumnHandle.java
index fb9a0ba..4ec145d 100755
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataColumnHandle.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataColumnHandle.java
@@ -25,8 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 
 import java.util.Objects;
 
-//import static com.google.common.base.MoreObjects.toStringHelper;
-import static com.google.common.base.Objects.toStringHelper;
+import static com.google.common.base.MoreObjects.toStringHelper;
 import static java.util.Objects.requireNonNull;
 
 public class CarbondataColumnHandle implements ColumnHandle {

http://git-wip-us.apache.org/repos/asf/carbondata/blob/ccb65603/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataConnector.java
----------------------------------------------------------------------
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataConnector.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataConnector.java
index 406ed93..25917ac 100755
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataConnector.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataConnector.java
@@ -51,7 +51,7 @@ public class CarbondataConnector implements Connector {
   @Override public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel,
       boolean readOnly) {
     checkConnectorSupports(READ_COMMITTED, isolationLevel);
-    return CarbondataTransactionHandle.INSTANCE;
+    return new CarbondataTransactionHandle();
   }
 
   @Override public ConnectorMetadata getMetadata(ConnectorTransactionHandle transactionHandle)
{

http://git-wip-us.apache.org/repos/asf/carbondata/blob/ccb65603/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataPageSource.java
----------------------------------------------------------------------
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataPageSource.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataPageSource.java
index fd65230..390565b 100644
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataPageSource.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataPageSource.java
@@ -78,10 +78,6 @@ class CarbondataPageSource implements ConnectorPageSource {
     this.readers = createStreamReaders();
   }
 
-  @Override public long getTotalBytes() {
-    return sizeOfData;
-  }
-
   @Override public long getCompletedBytes() {
     return sizeOfData;
   }

http://git-wip-us.apache.org/repos/asf/carbondata/blob/ccb65603/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataRecordCursor.java
----------------------------------------------------------------------
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataRecordCursor.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataRecordCursor.java
index 4663903..c614fa9 100755
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataRecordCursor.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataRecordCursor.java
@@ -22,7 +22,6 @@ import java.math.BigInteger;
 import java.sql.Timestamp;
 import java.util.List;
 
-import org.apache.carbondata.common.CarbonIterator;
 import org.apache.carbondata.core.cache.dictionary.Dictionary;
 import org.apache.carbondata.core.metadata.datatype.DataType;
 
@@ -73,10 +72,6 @@ public class CarbondataRecordCursor implements RecordCursor {
     this.totalBytes = 0;
   }
 
-  @Override public long getTotalBytes() {
-    return totalBytes;
-  }
-
   @Override public long getCompletedBytes() {
     return totalBytes;
   }

http://git-wip-us.apache.org/repos/asf/carbondata/blob/ccb65603/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataTableLayoutHandle.java
----------------------------------------------------------------------
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataTableLayoutHandle.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataTableLayoutHandle.java
index bf6318f..fbaa1d2 100755
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataTableLayoutHandle.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataTableLayoutHandle.java
@@ -25,8 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 
 import java.util.Objects;
 
-//import static com.google.common.base.MoreObjects.toStringHelper;
-import static com.google.common.base.Objects.toStringHelper;
+import static com.google.common.base.MoreObjects.toStringHelper;
 import static java.util.Objects.requireNonNull;
 
 public class CarbondataTableLayoutHandle implements ConnectorTableLayoutHandle {

http://git-wip-us.apache.org/repos/asf/carbondata/blob/ccb65603/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataTransactionHandle.java
----------------------------------------------------------------------
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataTransactionHandle.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataTransactionHandle.java
index e95c490..7939d23 100755
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataTransactionHandle.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataTransactionHandle.java
@@ -17,8 +17,48 @@
 
 package org.apache.carbondata.presto;
 
+import java.util.Objects;
+import java.util.UUID;
+
 import com.facebook.presto.spi.connector.ConnectorTransactionHandle;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static java.util.Objects.requireNonNull;
+
+public class CarbondataTransactionHandle implements ConnectorTransactionHandle {
+  private final UUID uuid;
+
+  public CarbondataTransactionHandle() {
+    this(UUID.randomUUID());
+  }
+
+  @JsonCreator public CarbondataTransactionHandle(@JsonProperty("uuid") UUID uuid) {
+    this.uuid = requireNonNull(uuid, "uuid is null");
+  }
+
+  @JsonProperty public UUID getUuid() {
+    return uuid;
+  }
+
+  @Override public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if ((obj == null) || (getClass() != obj.getClass())) {
+      return false;
+    }
+
+    return Objects.equals(uuid, ((CarbondataTransactionHandle) obj).uuid);
+  }
+
+  @Override public int hashCode() {
+    return Objects.hash(uuid);
+  }
+
+  @Override public String toString() {
+    return toStringHelper(this).add("uuid", uuid).toString();
+  }
 
-public enum CarbondataTransactionHandle implements ConnectorTransactionHandle {
-  INSTANCE
 }

http://git-wip-us.apache.org/repos/asf/carbondata/blob/ccb65603/integration/presto/src/main/java/org/apache/carbondata/presto/readers/DecimalSliceStreamReader.java
----------------------------------------------------------------------
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/readers/DecimalSliceStreamReader.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/readers/DecimalSliceStreamReader.java
index 6612ab0..2f84bf4 100644
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/readers/DecimalSliceStreamReader.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/readers/DecimalSliceStreamReader.java
@@ -187,9 +187,9 @@ public class DecimalSliceStreamReader  extends AbstractStreamReader {
         builder.appendNull();
       } else {
         if (isShortDecimal(type)) {
-          long rescaledDecimal = Decimals
-              .rescale(columnVector.getDecimal(i, precision, scale).toLong(),
-                  columnVector.getDecimal(i, precision, scale).scale(), scale);
+          BigDecimal decimalValue = columnVector.getDecimal(i, precision, scale).toJavaBigDecimal();
+          long rescaledDecimal = Decimals.rescale(decimalValue.unscaledValue().longValue(),
+              decimalValue.scale(), scale);
           type.writeLong(builder, rescaledDecimal);
         } else {
           Slice slice =

http://git-wip-us.apache.org/repos/asf/carbondata/blob/ccb65603/integration/presto/src/test/scala/org/apache/carbondata/presto/server/PrestoServer.scala
----------------------------------------------------------------------
diff --git a/integration/presto/src/test/scala/org/apache/carbondata/presto/server/PrestoServer.scala
b/integration/presto/src/test/scala/org/apache/carbondata/presto/server/PrestoServer.scala
index cdf8833..d6d3617 100644
--- a/integration/presto/src/test/scala/org/apache/carbondata/presto/server/PrestoServer.scala
+++ b/integration/presto/src/test/scala/org/apache/carbondata/presto/server/PrestoServer.scala
@@ -18,7 +18,7 @@ package org.apache.carbondata.presto.server
 
 import java.sql.{Connection, DriverManager, ResultSet}
 import java.util
-import java.util.{Locale, Optional}
+import java.util.{Locale, Optional, Properties}
 
 import scala.collection.JavaConverters._
 import scala.util.{Failure, Success, Try}
@@ -119,14 +119,14 @@ object PrestoServer {
     val JDBC_DRIVER = "com.facebook.presto.jdbc.PrestoDriver"
     val DB_URL = "jdbc:presto://localhost:8086/carbondata/testdb"
 
+    val properties = new Properties
     // The database Credentials
-    val USER = "username"
-    val PASS = "password"
-
+    properties.setProperty("user", "test");
+  
     // STEP 2: Register JDBC driver
     Class.forName(JDBC_DRIVER)
     // STEP 3: Open a connection
-    DriverManager.getConnection(DB_URL, USER, PASS)
+    DriverManager.getConnection(DB_URL, properties)
   }
 
   /**


Mime
View raw message