use of org.talend.components.snowflake.runtime.SnowflakeReader in project components by Talend.
the class SnowflakeRuntimeIT method readRows.
protected List<IndexedRecord> readRows(SnowflakeConnectionTableProperties props, RuntimeContainer container) throws IOException {
TSnowflakeInputProperties inputProps = null;
if (props instanceof TSnowflakeInputProperties) {
inputProps = (TSnowflakeInputProperties) props;
} else {
inputProps = (TSnowflakeInputProperties) new TSnowflakeInputProperties("bar").init();
}
inputProps.connection = props.connection;
inputProps.table = props.table;
BoundedReader<IndexedRecord> reader = (SnowflakeReader) createBoundedReader(inputProps, container);
boolean hasRecord = reader.start();
List<IndexedRecord> rows = new ArrayList<>();
while (hasRecord) {
org.apache.avro.generic.IndexedRecord unenforced = reader.getCurrent();
rows.add(unenforced);
hasRecord = reader.advance();
}
reader.close();
return rows;
}
Aggregations