Skip to content

Commit

Permalink
SNOW-1782852: Testing arrow too many rows
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dprzybysz committed Nov 5, 2024
1 parent fd0ddd5 commit 6fd955a
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
*/
package net.snowflake.client.jdbc;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import net.snowflake.client.category.TestCategoryArrow;
import org.junit.Test;
import org.junit.experimental.categories.Category;

/**
Expand All @@ -15,4 +22,27 @@ public class ResultSetArrowLatestIT extends ResultSetLatestIT {
public ResultSetArrowLatestIT() {
super("arrow");
}

// TODO move to parent - for now we only want to test ARROW
@Test
public void testChunkedResultSetHasExpectedNumberOfRows() throws SQLException {
int rowsToGet = 8295305;
int count = 0;
long seq8 = -1;
try (Statement statement = connection.createStatement();
ResultSet resultSet =
statement.executeQuery(
"select randstr(20,random()), seq8() as s from table(generator(rowcount=>"
+ rowsToGet
+ ")) where 1=1 and s >= 0 "
+ "order by s")) {
while (resultSet.next()) {
count++;
long newSeq8 = resultSet.getLong(2);
assertTrue(seq8 < newSeq8);
seq8 = newSeq8;
}
}
assertEquals(rowsToGet, count);
}
}

0 comments on commit 6fd955a

Please sign in to comment.