You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tajo.apache.org by hy...@apache.org on 2013/03/24 13:35:33 UTC
git commit: TAJO-1: RCFileWrapper always reads whole columns
regardless of the target schema (jihoonson via hyunsik)
Updated Branches:
refs/heads/master 01c1262fb -> e91cc9ebe
TAJO-1: RCFileWrapper always reads whole columns regardless of the target schema (jihoonson via hyunsik)
Project: http://git-wip-us.apache.org/repos/asf/incubator-tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tajo/commit/e91cc9eb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tajo/tree/e91cc9eb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tajo/diff/e91cc9eb
Branch: refs/heads/master
Commit: e91cc9ebe1f586f5d40ff87665a34cae1693caa0
Parents: 01c1262
Author: Hyunsik Choi <hy...@apache.org>
Authored: Sun Mar 24 21:26:57 2013 +0900
Committer: Hyunsik Choi <hy...@apache.org>
Committed: Sun Mar 24 21:34:54 2013 +0900
----------------------------------------------------------------------
CHANGES.txt | 13 +++++++++++++
.../java/tajo/storage/rcfile/RCFileWrapper.java | 9 +++++----
.../src/test/java/tajo/storage/TestStorages.java | 4 ++++
3 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/e91cc9eb/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
new file mode 100644
index 0000000..75974d8
--- /dev/null
+++ b/CHANGES.txt
@@ -0,0 +1,13 @@
+Tajo Change Log
+
+Release 0.2.0 - unreleased
+
+ NEW FEATURES
+
+ IMPROVEMENTS
+
+ BUG FIXES
+
+ TAJO-1: RCFileWrapper always reads whole columns regardless of the target
+ schema. (jihoonson via hyunsik)
+
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/e91cc9eb/tajo-core/tajo-core-storage/src/main/java/tajo/storage/rcfile/RCFileWrapper.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-storage/src/main/java/tajo/storage/rcfile/RCFileWrapper.java b/tajo-core/tajo-core-storage/src/main/java/tajo/storage/rcfile/RCFileWrapper.java
index de01b68..aafdbbf 100644
--- a/tajo-core/tajo-core-storage/src/main/java/tajo/storage/rcfile/RCFileWrapper.java
+++ b/tajo-core/tajo-core-storage/src/main/java/tajo/storage/rcfile/RCFileWrapper.java
@@ -172,10 +172,6 @@ public class RCFileWrapper {
super(conf, meta, fragment);
fs = fragment.getPath().getFileSystem(conf);
- reader = new RCFile.Reader(fs, fragment.getPath(), conf);
- if (fragment.getStartOffset() > reader.getPosition()) {
- reader.sync(fragment.getStartOffset()); // sync to start
- }
end = fragment.getStartOffset() + fragment.getLength();
more = fragment.getStartOffset() < end;
@@ -191,6 +187,11 @@ public class RCFileWrapper {
prepareProjection(targets);
+ reader = new RCFile.Reader(fs, fragment.getPath(), conf);
+ if (fragment.getStartOffset() > reader.getPosition()) {
+ reader.sync(fragment.getStartOffset()); // sync to start
+ }
+
super.init();
}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/e91cc9eb/tajo-core/tajo-core-storage/src/test/java/tajo/storage/TestStorages.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-storage/src/test/java/tajo/storage/TestStorages.java b/tajo-core/tajo-core-storage/src/test/java/tajo/storage/TestStorages.java
index dd15877..dd850a7 100644
--- a/tajo-core/tajo-core-storage/src/test/java/tajo/storage/TestStorages.java
+++ b/tajo-core/tajo-core-storage/src/test/java/tajo/storage/TestStorages.java
@@ -38,6 +38,7 @@ import java.util.Arrays;
import java.util.Collection;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
@RunWith(Parameterized.class)
public class TestStorages {
@@ -165,6 +166,9 @@ public class TestStorages {
int tupleCnt = 0;
Tuple tuple;
while ((tuple = scanner.next()) != null) {
+ if (storeType == StoreType.RCFILE || storeType == StoreType.TREVNI) {
+ assertNull(tuple.get(0));
+ }
assertEquals(DatumFactory.createLong(tupleCnt + 2), tuple.getLong(1));
assertEquals(DatumFactory.createFloat(tupleCnt + 3), tuple.getFloat(2));
tupleCnt++;