Skip to content

Commit

Permalink
0004311: DataExtractorService: Stream row query with null values does
Browse files Browse the repository at this point in the history
not deal with the null values correctly
  • Loading branch information
philipmarzullo64 committed Mar 12, 2020
1 parent 824dcec commit bffef0e
Showing 1 changed file with 15 additions and 1 deletion.
Expand Up @@ -2538,8 +2538,22 @@ public CsvData next() {
sourceTable = columnsAccordingToTriggerHistory.lookup(triggerRouter
.getRouter().getRouterId(), triggerHistory, false, true);
Column[] columns = sourceTable.getPrimaryKeyColumns();
DmlStatement dmlStmt = platform.createDmlStatement(DmlType.WHERE, sourceTable, null);
String[] pkData = data.getParsedData(CsvData.PK_DATA);
boolean[] nullKeyValues = new boolean[columns.length];
for (int i = 0; i < columns.length; i++) {
Column column = columns[i];
nullKeyValues[i] = !column.isRequired()
&& pkData[i] == null;
}
DmlStatement dmlStmt = platform.createDmlStatement(
DmlType.WHERE,
sourceTable.getCatalog(),
sourceTable.getSchema(),
sourceTable.getName(),
sourceTable.getPrimaryKeyColumns(),
sourceTable.getColumns(),
nullKeyValues,
null);
Row row = new Row(columns.length);

for (int i = 0; i < columns.length; i++) {
Expand Down

0 comments on commit bffef0e

Please sign in to comment.