You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by ni...@apache.org on 2016/02/16 22:01:20 UTC

incubator-systemml git commit: Fix NullPointerException bug in transform

Repository: incubator-systemml
Updated Branches:
  refs/heads/master 17ea62a31 -> d25ba0d8c


Fix NullPointerException bug in transform

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

Branch: refs/heads/master
Commit: d25ba0d8c834a380f893d6406b0d7f39dbfad293
Parents: 17ea62a
Author: Niketan Pansare <np...@us.ibm.com>
Authored: Tue Feb 16 13:01:21 2016 -0800
Committer: Niketan Pansare <np...@us.ibm.com>
Committed: Tue Feb 16 13:01:21 2016 -0800

----------------------------------------------------------------------
 .../java/org/apache/sysml/runtime/transform/DataTransform.java | 2 +-
 .../java/org/apache/sysml/runtime/transform/GTFMTDMapper.java  | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/d25ba0d8/src/main/java/org/apache/sysml/runtime/transform/DataTransform.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/transform/DataTransform.java b/src/main/java/org/apache/sysml/runtime/transform/DataTransform.java
index c776c6c..1b85a3f 100644
--- a/src/main/java/org/apache/sysml/runtime/transform/DataTransform.java
+++ b/src/main/java/org/apache/sysml/runtime/transform/DataTransform.java
@@ -795,7 +795,7 @@ public class DataTransform {
 		// Parse transform instruction (the first instruction) to obtain relevant fields
 		TransformOperands oprnds = new TransformOperands(insts[0], inputMatrices[0]);
 		
-		JobConf job = new JobConf(ConfigurationManager.getCachedJobConf());
+		JobConf job = new JobConf(DataTransform.class); // ConfigurationManager.getCachedJobConf());
 		FileSystem fs = FileSystem.get(job);
 		
 		// find the first file in alphabetical ordering of partfiles in directory inputPath 

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/d25ba0d8/src/main/java/org/apache/sysml/runtime/transform/GTFMTDMapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/transform/GTFMTDMapper.java b/src/main/java/org/apache/sysml/runtime/transform/GTFMTDMapper.java
index 3409ee4..1e45036 100644
--- a/src/main/java/org/apache/sysml/runtime/transform/GTFMTDMapper.java
+++ b/src/main/java/org/apache/sysml/runtime/transform/GTFMTDMapper.java
@@ -96,7 +96,11 @@ public class GTFMTDMapper implements Mapper<LongWritable, Text, IntWritable, Dis
 		
 		// Output part-file offsets to create OFFSETS_FILE, which is to be used in csv reblocking.
 		// OffsetCount is denoted as a DistinctValue by concatenating parfile name and offset within partfile.
-		_collector.collect(new IntWritable((int)_agents.getNumCols()+1), new DistinctValue(new OffsetCount(_partFileName, _offsetInPartFile, _agents.getValid())));
+		if(_collector != null) {
+			IntWritable key = new IntWritable((int)_agents.getNumCols()+1);
+			DistinctValue val = new DistinctValue(new OffsetCount(_partFileName, _offsetInPartFile, _agents.getValid())); 
+			_collector.collect(key, val);
+		}
 		
 		// reset global variables, required when the jvm is reused.
 		_firstRecordInSplit = true;