Skip to content

Commit 7c4158a

Browse files
committed
revert to support the recently added remove case
1 parent 8c0f7b0 commit 7c4158a

File tree

4 files changed

+4
-61
lines changed

4 files changed

+4
-61
lines changed

src/main/java/org/apache/sysds/runtime/transform/encode/ColumnEncoder.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,6 @@ public List<DependencyTask<?>> getApplyTasks(CacheBlock<?> in, MatrixBlock out,
425425
return new ColumnApplyTask<>(this, in, out, outputCol, startRow, blk);
426426
}
427427

428-
// public Set<Integer> getSparseRowsWZeros(){
429-
// if (_sparseRowsWZeros != null) {
430-
// return new HashSet<>(_sparseRowsWZeros);
431-
// }
432-
// else
433-
// return null;
434-
// }
435-
436428
protected void addSparseRowsWZeros(List<Integer> sparseRowsWZeros){
437429
synchronized (this){
438430
if(_sparseRowsWZeros == null)
@@ -441,13 +433,6 @@ protected void addSparseRowsWZeros(List<Integer> sparseRowsWZeros){
441433
}
442434

443435
}
444-
// protected void addSparseRowsWZeros(ArrayList<Integer> sparseRowsWZeros){
445-
// synchronized (this){
446-
// if(_sparseRowsWZeros == null)
447-
// _sparseRowsWZeros = new ArrayList<>();
448-
// _sparseRowsWZeros.addAll(sparseRowsWZeros);
449-
// }
450-
// }
451436

452437
protected boolean containsZeroOut(){
453438
return containsZeroOut;

src/main/java/org/apache/sysds/runtime/transform/encode/ColumnEncoderComposite.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -423,15 +423,6 @@ public void shiftCol(int columnOffset) {
423423
_columnEncoders.forEach(e -> e.shiftCol(columnOffset));
424424
}
425425

426-
// @Override
427-
// public Set<Integer> getSparseRowsWZeros(){
428-
// return _columnEncoders.stream().map(ColumnEncoder::getSparseRowsWZeros).flatMap(l -> {
429-
// if(l == null)
430-
// return null;
431-
// return l.stream();
432-
// }).collect(Collectors.toSet());
433-
// }
434-
435426
protected boolean containsZeroOut(){
436427
for(int i = 0; i < _columnEncoders.size(); i++)
437428
if(_columnEncoders.get(i).containsZeroOut())

src/main/java/org/apache/sysds/runtime/transform/encode/ColumnEncoderPassThrough.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -82,39 +82,6 @@ protected double[] getCodeCol(CacheBlock<?> in, int startInd, int endInd, double
8282
}
8383

8484
protected void applySparse(CacheBlock<?> in, MatrixBlock out, int outputCol, int rowStart, int blk){
85-
//Set<Integer> sparseRowsWZeros = null;
86-
// ArrayList<Integer> sparseRowsWZeros = null;
87-
// boolean mcsr = MatrixBlock.DEFAULT_SPARSEBLOCK == SparseBlock.Type.MCSR;
88-
// mcsr = false; //force CSR for transformencode
89-
// int index = _colID - 1;
90-
// // Apply loop tiling to exploit CPU caches
91-
// int rowEnd = getEndIndex(in.getNumRows(), rowStart, blk);
92-
// double[] codes = getCodeCol(in, rowStart, rowEnd, null);
93-
// int B = 32; //tile size
94-
// for(int i = rowStart; i < rowEnd; i+=B) {
95-
// int lim = Math.min(i+B, rowEnd);
96-
// for (int ii=i; ii<lim; ii++) {
97-
// double v = codes[ii-rowStart];
98-
// if(v == 0) {
99-
// if(sparseRowsWZeros == null)
100-
// sparseRowsWZeros = new ArrayList<>();
101-
// sparseRowsWZeros.add(ii);
102-
// }
103-
// int indexWithOffset = sparseRowPointerOffset != null ? sparseRowPointerOffset[ii] - 1 + index : index;
104-
// if (mcsr) {
105-
// SparseRowVector row = (SparseRowVector) out.getSparseBlock().get(ii);
106-
// row.values()[indexWithOffset] = v;
107-
// row.indexes()[indexWithOffset] = outputCol;
108-
// }
109-
// else { //csr
110-
// // Manually fill the column-indexes and values array
111-
// SparseBlockCSR csrblock = (SparseBlockCSR)out.getSparseBlock();
112-
// int rptr[] = csrblock.rowPointers();
113-
// csrblock.indexes()[rptr[ii]+indexWithOffset] = outputCol;
114-
// csrblock.values()[rptr[ii]+indexWithOffset] = codes[ii-rowStart];
115-
// }
116-
// }
117-
11885
final SparseBlock sb = out.getSparseBlock();
11986
final boolean mcsr = sb instanceof SparseBlockMCSR;
12087
final int index = _colID - 1;

src/main/java/org/apache/sysds/runtime/transform/encode/EncoderFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ public static MultiColumnEncoder createEncoder(String spec, String[] colnames, i
132132

133133
// List<Integer> ptIDs = except(except(except(UtilFunctions.getSeqList(1, clen, 1), unionDistinct(rcIDs, haIDs)), binIDs), weIDs);
134134

135-
List<Integer> oIDs = Arrays.asList(ArrayUtils
136-
.toObject(TfMetaUtils.parseJsonIDList(jSpec, colnames, TfMethod.OMIT.toString(), minCol, maxCol)));
137-
List<Integer> mvIDs = Arrays.asList(ArrayUtils.toObject(
138-
TfMetaUtils.parseJsonObjectIDList(jSpec, colnames, TfMethod.IMPUTE.toString(), minCol, maxCol)));
135+
List<Integer> oIDs = new ArrayList<>(Arrays.asList(ArrayUtils
136+
.toObject(TfMetaUtils.parseJsonIDList(jSpec, colnames, TfMethod.OMIT.toString(), minCol, maxCol))));
137+
List<Integer> mvIDs = new ArrayList<>(Arrays.asList(ArrayUtils.toObject(
138+
TfMetaUtils.parseJsonObjectIDList(jSpec, colnames, TfMethod.IMPUTE.toString(), minCol, maxCol))));
139139
List<Integer> udfIDs = TfMetaUtils.parseUDFColIDs(jSpec, colnames, minCol, maxCol);
140140

141141
// robustness for transformencode specs w/ non-existing columns (so far, endless loops)

0 commit comments

Comments
 (0)