Skip to content

Commit 7bcb4f3

Browse files
committed
Fix SqlServer random query unit test
1 parent 9d08b68 commit 7bcb4f3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mssql-plugin/src/test/java/io/cdap/plugin/mssql/SqlServerConnectorUnitTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,18 @@ public class SqlServerConnectorUnitTest {
3636
@Test
3737
public void getTableQueryTest() {
3838
String tableName = "\"db\".\"schema\".\"table\"";
39+
int limit = 100;
3940

4041
// default query
41-
Assert.assertEquals(String.format("SELECT TOP %d * FROM %s", 100, tableName),
42+
Assert.assertEquals(String.format("SELECT TOP %d * FROM %s", limit, tableName),
4243
CONNECTOR.getTableQuery("db", "schema", "table",
43-
100));
44+
limit));
4445

4546
// random query
4647
Assert.assertEquals(String.format("SELECT * FROM %s " +
4748
"WHERE (ABS(CAST((BINARY_CHECKSUM(*) * RAND()) as int)) %% 100) " +
4849
"< %d / (SELECT COUNT(*) FROM %s)",
49-
tableName, 100, tableName),
50-
CONNECTOR.getRandomQuery(tableName, 100));
50+
tableName, limit * 100, tableName),
51+
CONNECTOR.getRandomQuery(tableName, limit));
5152
}
5253
}

0 commit comments

Comments
 (0)