drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [21/50] [abbrv] drill git commit: Updated with the OJAI APIs changes in Date/Time/Document classes.
Date Tue, 13 Sep 2016 01:32:08 GMT
Updated with the OJAI APIs changes in Date/Time/Document classes.


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

Branch: refs/heads/master
Commit: 004aad9db375972556980cb608f439d13382a7dd
Parents: 1887de2
Author: Aditya <aditya@mapr.com>
Authored: Sun Jan 3 21:23:06 2016 -0800
Committer: Aditya Kishore <adi@apache.org>
Committed: Fri Sep 9 10:08:33 2016 -0700

----------------------------------------------------------------------
 .../maprdb/json/CompareFunctionsProcessor.java  | 19 ++++++-----------
 .../maprdb/json/MaprDBJsonRecordReader.java     | 22 ++++++++++----------
 2 files changed, 17 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/004aad9d/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/CompareFunctionsProcessor.java
----------------------------------------------------------------------
diff --git a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/CompareFunctionsProcessor.java
b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/CompareFunctionsProcessor.java
index 836361b..2e191a1 100644
--- a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/CompareFunctionsProcessor.java
+++ b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/CompareFunctionsProcessor.java
@@ -1,11 +1,5 @@
 package org.apache.drill.exec.store.maprdb.json;
 
-import java.sql.Date;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.Calendar;
-import java.util.TimeZone;
-
 import org.apache.drill.common.expression.FunctionCall;
 import org.apache.drill.common.expression.LogicalExpression;
 import org.apache.drill.common.expression.SchemaPath;
@@ -16,16 +10,15 @@ import org.apache.drill.common.expression.ValueExpressions.Decimal38Expression;
 import org.apache.drill.common.expression.ValueExpressions.DoubleExpression;
 import org.apache.drill.common.expression.ValueExpressions.FloatExpression;
 import org.apache.drill.common.expression.ValueExpressions.IntExpression;
-import org.apache.drill.common.expression.ValueExpressions.IntervalDayExpression;
-import org.apache.drill.common.expression.ValueExpressions.IntervalYearExpression;
 import org.apache.drill.common.expression.ValueExpressions.LongExpression;
 import org.apache.drill.common.expression.ValueExpressions.QuotedString;
 import org.apache.drill.common.expression.ValueExpressions.TimeExpression;
 import org.apache.drill.common.expression.ValueExpressions.TimeStampExpression;
 import org.apache.drill.common.expression.visitors.AbstractExprVisitor;
 import org.ojai.Value;
-
-import static org.ojai.util.Constants.MILLISECONDSPERDAY;
+import org.ojai.types.ODate;
+import org.ojai.types.OTime;
+import org.ojai.types.OTimestamp;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
@@ -141,19 +134,19 @@ class CompareFunctionsProcessor extends AbstractExprVisitor<Boolean,
LogicalExpr
     }
 /*
     if (valueArg instanceof DateExpression) {
-      this.value = KeyValueBuilder.initFrom(new Date(((DateExpression)valueArg).getDate()));
+      this.value = KeyValueBuilder.initFrom(new ODate(((DateExpression)valueArg).getDate()));
       this.path = path;
       return true;
     }
 
     if (valueArg instanceof TimeExpression) {
-      this.value = KeyValueBuilder.initFrom(new Time(((TimeExpression)valueArg).getTime()));
+      this.value = KeyValueBuilder.initFrom(new OTime(((TimeExpression)valueArg).getTime()));
       this.path = path;
       return true;
     }
 
     if (valueArg instanceof TimeStampExpression) {
-      this.value = KeyValueBuilder.initFrom(new Timestamp(((TimeStampExpression)valueArg).getTimeStamp()));
+      this.value = KeyValueBuilder.initFrom(new OTimestamp(((TimeStampExpression)valueArg).getTimeStamp()));
       this.path = path;
       return true;
     }

http://git-wip-us.apache.org/repos/asf/drill/blob/004aad9d/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
----------------------------------------------------------------------
diff --git a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
index fbb67de..fd8bf93 100644
--- a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
+++ b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
@@ -44,6 +44,7 @@ import org.apache.drill.exec.vector.complex.writer.BaseWriter.ListWriter;
 import org.apache.drill.exec.vector.complex.writer.BaseWriter.MapWriter;
 import org.apache.drill.exec.vector.complex.writer.VarBinaryWriter;
 import org.apache.drill.exec.vector.complex.writer.VarCharWriter;
+import org.ojai.Document;
 import org.ojai.DocumentReader;
 import org.ojai.DocumentReader.EventType;
 import org.ojai.DocumentStream;
@@ -56,7 +57,6 @@ import com.google.common.base.Preconditions;
 import com.google.common.base.Stopwatch;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
-import com.mapr.db.DBDocument;
 import com.mapr.db.MapRDB;
 import com.mapr.db.Table;
 import com.mapr.db.Table.TableOption;
@@ -83,7 +83,7 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
 
   private DrillBuf buffer;
 
-  private DocumentStream<DBDocument> documentStream;
+  private DocumentStream<Document> documentStream;
 
   private Iterator<DocumentReader> documentReaderIterators;
   
@@ -237,12 +237,12 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
         break;
       case DECIMAL:
         throw new UnsupportedOperationException("Decimals are currently not supported.");
-      //case DATE:
-      //  map.date(fieldName).writeDate(reader.getDate().getTime());
-      //  break;
-      //case TIME:
-      //  map.time(fieldName).writeTime(reader.getTimeInt());
-      //  break;
+      case DATE:
+        map.date(fieldName).writeDate(reader.getDate().toDate().getTime());
+        break;
+      case TIME:
+        map.time(fieldName).writeTime(reader.getTimeInt());
+        break;
       case TIMESTAMP:
         map.timeStamp(fieldName).writeTimeStamp(reader.getTimestampLong());
         break;
@@ -302,9 +302,9 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
         break;
       case DECIMAL:
         throw new UnsupportedOperationException("Decimals are currently not supported.");
-      //case DATE:
-      //  list.date().writeDate(reader.getDate().getTime());
-      //  break;
+      case DATE:
+        list.date().writeDate(reader.getDate().toDate().getTime());
+        break;
       case TIME:
         list.time().writeTime(reader.getTimeInt());
         break;


Mime
View raw message