Skip to content

Commit

Permalink
Missing rangecheck in sparse-double-chunk compression
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffclick committed May 2, 2014
1 parent cb5adef commit 16cfc51
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion prj.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'(jde-run-option-debug nil)
'(jde-run-option-vm-args (quote ("-XX:+PrintGC")))
'(jde-compile-option-directory "./target/classes")
'(jde-run-option-application-args (quote ("-beta" "-mainClass" "org.junit.runner.JUnitCore" "water.exec.DdplyTest")))
'(jde-run-option-application-args (quote ("-beta" "-mainClass" "org.junit.runner.JUnitCore" "water.fvec.ParserTest2")))
'(jde-debugger (quote ("JDEbug")))
'(jde-compile-option-source (quote ("1.6")))
'(jde-compile-option-classpath (quote ("./target/classes" "./lib/javassist.jar" "./lib/hadoop/cdh4/hadoop-common.jar" "./lib/hadoop/cdh4/hadoop-auth.jar" "./lib/hadoop/cdh4/slf4j-api-1.6.1.jar" "./lib/hadoop/cdh4/slf4j-nop-1.6.1.jar" "./lib/hadoop/cdh4/hadoop-hdfs.jar" "./lib/hadoop/cdh4/protobuf-java-2.4.0a.jar" "./lib/apache/commons-codec-1.4.jar" "./lib/apache/commons-configuration-1.6.jar" "./lib/apache/commons-lang-2.4.jar" "./lib/apache/commons-logging-1.1.1.jar" "./lib/apache/httpclient-4.1.1.jar" "./lib/apache/httpcore-4.1.jar" "./lib/junit/junit-4.11.jar" "./lib/apache/guava-12.0.1.jar" "./lib/gson/gson-2.2.2.jar" "./lib/poi/poi-3.8-20120326.jar" "./lib/poi/poi-ooxml-3.8-20120326.jar" "./lib/poi/poi-ooxml-schemas-3.8-20120326.jar" "./lib/poi/dom4j-1.6.1.jar" "./lib/Jama/Jama.jar" "./lib/s3/aws-java-sdk-1.3.27.jar" "./lib/log4j/log4j-1.2.15.jar" "./lib/joda/joda-time-2.3.jar")))
Expand Down
1 change: 0 additions & 1 deletion src/main/java/water/api/RequestBuilders.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package water.api;

import com.google.gson.*;
import org.json.JSONObject;
import water.AutoBuffer;
import water.H2O;
import water.Iced;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/water/fvec/NewChunk.java
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ private Chunk chunkD() {
int j = 0;
for(int i = 0; i < _len2; ++i){
double d = 0;
if(_id == null || _id[j] == i){
if(_id == null || (j < _id.length && _id[j] == i)) {
d = _ds != null?_ds[j]:(isNA2(j)||isEnum(j))?Double.NaN:_ls[j]*DParseTask.pow10(_xs[j]);
++j;
}
Expand Down
10 changes: 10 additions & 0 deletions src/test/java/water/fvec/ParserTest2.java
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,16 @@ String[] getDataForSeparator(char placeholder, char sep, String[] data) {
for( int i=0; i<100; i+=2 ) { exp[i+100][0]=-1001; exp[i+101][0]= 1001; }
k = FVecTest.makeByteVec(Key.make().toString(),sb.toString());
testParsed(k,exp);

// Build 100 zero's and 1 double.
exp = new double[101][1];
exp[50][0] = 1.23456789;
sb = new StringBuilder();
for( int i=0; i<50; i++ ) sb.append("0.0\n");
sb.append("1.23456789\n");
for( int i=0; i<50; i++ ) sb.append("0.0\n");
k = FVecTest.makeByteVec(Key.make().toString(),sb.toString());
testParsed(k,exp);
}
}

Expand Down

0 comments on commit 16cfc51

Please sign in to comment.