Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public boolean nextKeyValue() throws IOException, InterruptedException {
while (cellIterator.hasNext()) {
Cell cell = cellIterator.next();
String colName = CellReference.convertNumToColString(cell.getColumnIndex());
String colValue = "";
switch (cell.getCellType()) {
case Cell.CELL_TYPE_STRING:
sb.append(colName)
Expand All @@ -218,6 +219,10 @@ public boolean nextKeyValue() throws IOException, InterruptedException {
.append(COLUMN_SEPERATOR).append(cell.getNumericCellValue()).append(CELL_SEPERATOR);
}
break;

case Cell.CELL_TYPE_BLANK:
sb.append(colName).append(COLUMN_SEPERATOR).append(colValue).append(CELL_SEPERATOR);
break;
}
}
value = new Text(sb.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class ExcelInputReader extends BatchSource<LongWritable, Object, Structur
private static final String RECORD = "record";
private static final String EXIT_ON_ERROR = "Exit on error";
private static final String WRITE_ERROR_DATASET = "Write to error dataset";
private static final String NULL = "NULL";
private static final String NULL = "";
private static final String END = "END";
private static final String SHEET_NO = "Sheet Number";

Expand Down Expand Up @@ -201,10 +201,12 @@ public void transform(KeyValue<LongWritable, Object> input, Emitter<StructuredRe

for (String column : excelRecord) {
String[] columnValue = column.split(COLUMN_SEPERATION);
if (columnValue.length > 1) {
if (columnValue.length >= 1) {
String name = columnValue[0];
String value = columnValue[1];

String value = "";
if (columnValue.length > 1) {
value = columnValue[1];
}
if (columnMapping.containsKey(name)) {
excelColumnValueMap.put(columnMapping.get(name), value);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void testExcelInputReader() throws Exception {
nameIdMap.put("john", "3.0");
nameIdMap.put("romy", "1.0");
nameIdMap.put("Paulo", "11.0");
nameIdMap.put("Ruskin", "10.0");
nameIdMap.put("", "10.0");
nameIdMap.put("Alan", "8.0");
nameIdMap.put("Bill", "13.0");
nameIdMap.put("Ada", "14.0");
Expand Down
Binary file modified core-plugins/src/test/resources/civil_test_data_two.xlsx
Binary file not shown.