本文整理了Java中org.apache.flink.types.Row.copy
方法的一些代码示例,展示了Row.copy
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row.copy
方法的具体详情如下:
包路径:org.apache.flink.types.Row
类名称:Row
方法名:copy
[英]Creates a new Row which copied from another row. This method does not perform a deep copy.
[中]创建从另一行复制的新行。此方法不执行深度复制。
代码示例来源:origin: apache/flink
@Test
public void testRowCopy() {
Row row = new Row(5);
row.setField(0, 1);
row.setField(1, "hello");
row.setField(2, null);
row.setField(3, new Tuple2<>(2, "hi"));
row.setField(4, "hello world");
Row copy = Row.copy(row);
assertEquals(row, copy);
assertTrue(row != copy);
}
代码示例来源:origin: com.alibaba.blink/flink-table
@Override
protected Row convert(Row current) {
if (reuse == null) {
return Row.copy(current);
} else {
for (int i = 0; i < current.getArity(); ++i) {
reuse.setField(i, current.getField(i));
}
return reuse;
}
}
}
代码示例来源:origin: com.alibaba.blink/flink-table
@Override
public Row convert(Row current) {
if (reuse == null) {
return Row.copy(current);
} else {
Preconditions.checkArgument(current.getArity() == reuse.getArity());
for (int i = 0; i < current.getArity(); ++i) {
reuse.setField(i, current.getField(i));
}
return reuse;
}
}
内容来源于网络,如有侵权,请联系作者删除!