-
Notifications
You must be signed in to change notification settings - Fork 75
Labels
Milestone
Description
I discovered that any time I tried to get the schema of a large table (large number of rows not columns), it would work much too long and then eventually fail when heap memory was exhausted. However, after moving my code out of a notebook and into standalone code it was pretty easy to find in the debugger. The SQL Server sqlQueryLimit() function correctly inserted the TOP clause but then threw the altered string away and returned the original string:
public override fun sqlQueryLimit(sqlQuery: String, limit: Int): String {
sqlQuery.replace("SELECT", "SELECT TOP $limit", ignoreCase = true)
return sqlQuery
}
String.replace() returns the altered string. I forked, created a unit test, and fixed the bug. I'll be submitting a PR immediately after posting this.