Skip to content

Commit 7413227

Browse files
Admin_mschuemiAdmin_mschuemi
authored andcommitted
Making querySql() less inefficient for large queries.
1 parent 36c6e2e commit 7413227

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Changes:
1111

1212
4. Updating IRIS JDBC driver.
1313

14+
5. Making `querySql()` less inefficient for large queries.
15+
1416
Bugfixes:
1517

1618
1. Converting double quotes to spaces when upload to DataBricks to avoid errors.

R/LowLevelFunctions.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,13 @@ getAllBatches <- function(batchedQuery) {
181181
if (any(columnTypes == 5)) {
182182
validateInt64Query()
183183
}
184-
columns <- data.frame()
184+
data <- list()
185185
while (!rJava::.jcall(batchedQuery, "Z", "isDone")) {
186186
rJava::.jcall(batchedQuery, "V", "fetchBatch")
187187
batch <- parseJdbcColumnData(batchedQuery,
188188
columnTypes = columnTypes)
189-
columns <- rbind(columns, batch)
189+
data[[length(data) + 1]] <- batch
190190
}
191-
return(columns)
191+
data <- bind_rows(data)
192+
return(data)
192193
}

0 commit comments

Comments
 (0)