drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [8/9] drill git commit: DRILL-1953: alter session set store.json.all_text_mode does not work as documented
Date Fri, 27 Feb 2015 08:02:02 GMT
DRILL-1953: alter session set store.json.all_text_mode does not work as documented


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

Branch: refs/heads/master
Commit: b49e51ef5e0f925cf3505f33b65309b1b839386d
Parents: 8100a97
Author: adeneche <adeneche@gmail.com>
Authored: Tue Feb 3 20:45:54 2015 -0800
Committer: Jason Altekruse <altekrusejason@gmail.com>
Committed: Thu Feb 26 16:41:04 2015 -0800

----------------------------------------------------------------------
 .../org/apache/drill/exec/store/mongo/MongoRecordReader.java   | 3 +--
 .../java/org/apache/drill/exec/server/DrillbitContext.java     | 4 ++++
 .../apache/drill/exec/store/easy/json/JSONRecordReader.java    | 2 +-
 .../org/apache/drill/exec/store/json/TestJsonRecordReader.java | 6 ++++++
 exec/java-exec/src/test/resources/jsoninput/big_numeric.json   | 1 +
 5 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/b49e51ef/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoRecordReader.java
----------------------------------------------------------------------
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoRecordReader.java
b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoRecordReader.java
index 5af63ff..da96701 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoRecordReader.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoRecordReader.java
@@ -100,8 +100,7 @@ public class MongoRecordReader extends AbstractRecordReader {
     Map<String, List<BasicDBObject>> mergedFilters = MongoUtils.mergeFilters(
         subScanSpec.getMinFilters(), subScanSpec.getMaxFilters());
     buildFilters(subScanSpec.getFilter(), mergedFilters);
-    enableAllTextMode = fragmentContext.getDrillbitContext().getOptionManager()
-        .getOption(ExecConstants.MONGO_ALL_TEXT_MODE).bool_val;
+    enableAllTextMode = fragmentContext.getOptions().getOption(ExecConstants.MONGO_ALL_TEXT_MODE).bool_val;
     init(subScanSpec);
   }
 

http://git-wip-us.apache.org/repos/asf/drill/blob/b49e51ef/exec/java-exec/src/main/java/org/apache/drill/exec/server/DrillbitContext.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/DrillbitContext.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/server/DrillbitContext.java
index 83a89df..0fb10ff 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/DrillbitContext.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/DrillbitContext.java
@@ -87,6 +87,10 @@ public class DrillbitContext {
     return workBus;
   }
 
+  /**
+   * @return the system options manager. It is important to note that this manager only contains
options at the
+   * "system" level and not "session" level.
+   */
   public SystemOptionManager getOptionManager() {
     return systemOptions;
   }

http://git-wip-us.apache.org/repos/asf/drill/blob/b49e51ef/exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/json/JSONRecordReader.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/json/JSONRecordReader.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/json/JSONRecordReader.java
index 557c0f0..c343177 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/json/JSONRecordReader.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/json/JSONRecordReader.java
@@ -70,7 +70,7 @@ public class JSONRecordReader extends AbstractRecordReader {
     this.fileSystem = fileSystem;
     this.fragmentContext = fragmentContext;
     this.columns = columns;
-    this.enableAllTextMode = fragmentContext.getDrillbitContext().getOptionManager().getOption(ExecConstants.JSON_ALL_TEXT_MODE).bool_val;
+    this.enableAllTextMode = fragmentContext.getOptions().getOption(ExecConstants.JSON_ALL_TEXT_MODE).bool_val;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/drill/blob/b49e51ef/exec/java-exec/src/test/java/org/apache/drill/exec/store/json/TestJsonRecordReader.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/store/json/TestJsonRecordReader.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/store/json/TestJsonRecordReader.java
index 449f091..c4bfcce 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/store/json/TestJsonRecordReader.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/store/json/TestJsonRecordReader.java
@@ -57,4 +57,10 @@ public class TestJsonRecordReader extends BaseTestQuery{
     final String sql = "select * from cp.`store/json/value-capacity.json`";
     test(sql);
   }
+
+  @Test
+  public void testEnableAllTextMode() throws Exception {
+    testNoResult("alter session set `store.json.all_text_mode`= true");
+    test("select * from cp.`jsoninput/big_numeric.json`");
+  }
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/b49e51ef/exec/java-exec/src/test/resources/jsoninput/big_numeric.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/jsoninput/big_numeric.json b/exec/java-exec/src/test/resources/jsoninput/big_numeric.json
new file mode 100644
index 0000000..df13d30
--- /dev/null
+++ b/exec/java-exec/src/test/resources/jsoninput/big_numeric.json
@@ -0,0 +1 @@
+{ "a1": 14994882832830675451 }
\ No newline at end of file


Mime
View raw message