gyfora commented on a change in pull request #78: Kudu Connector rework
URL: https://github.com/apache/bahir-flink/pull/78#discussion_r410402637
##########
File path:
flink-connector-kudu/src/main/java/org/apache/flink/connectors/kudu/connector/reader/KuduReaderIterator.java
##########
@@ -51,56 +52,63 @@ public boolean hasNext() throws KuduException {
}
}
- public KuduRow next() {
+ public Row next() {
RowResult row = this.rowIterator.next();
- return toKuduRow(row);
+ return toFlinkRow(row);
}
private void nextRows() throws KuduException {
this.rowIterator = scanner.nextRows();
}
- private KuduRow toKuduRow(RowResult row) {
+ private Row toFlinkRow(RowResult row) {
Schema schema = row.getColumnProjection();
- KuduRow values = new KuduRow(schema.getColumnCount());
+ Row values = new Row(schema.getColumnCount());
schema.getColumns().forEach(column -> {
String name = column.getName();
int pos = schema.getColumnIndex(name);
- if(row.isNull(name)) {
- values.setField(pos, name, null);
+ if (row.isNull(name)) {
+ values.setField(pos, null);
} else {
Type type = column.getType();
switch (type) {
case BINARY:
- values.setField(pos, name, row.getBinary(name));
+ values.setField(pos, row.getBinary(name));
Review comment:
yes, lets simplify that!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services