Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c7b121

Browse files
committed
more
1 parent270e27c commit7c7b121

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

‎src/databricks/sql/client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,4 +1230,4 @@ def setinputsizes(self, sizes):
12301230

12311231
defsetoutputsize(self,size,column=None):
12321232
"""Does nothing by default"""
1233-
pass
1233+
pass

‎src/databricks/sql/result_set.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ def fetchmany_arrow(self, size: int) -> "pyarrow.Table":
277277
ifsize<0:
278278
raiseValueError("size argument for fetchmany is %s but must be >= 0",size)
279279
results=self.results.next_n_rows(size)
280+
partial_result_chunks= [results]
280281
n_remaining_rows=size-results.num_rows
281282
self._next_row_index+=results.num_rows
282283

@@ -287,11 +288,11 @@ def fetchmany_arrow(self, size: int) -> "pyarrow.Table":
287288
):
288289
self._fill_results_buffer()
289290
partial_results=self.results.next_n_rows(n_remaining_rows)
290-
results=pyarrow.concat_tables([results,partial_results])
291+
partial_result_chunks.append(partial_results)
291292
n_remaining_rows-=partial_results.num_rows
292293
self._next_row_index+=partial_results.num_rows
293294

294-
returnresults
295+
returnpyarrow.concat_tables(partial_result_chunks,use_threads=True)
295296

296297
deffetchmany_columnar(self,size:int):
297298
"""
@@ -322,7 +323,7 @@ def fetchall_arrow(self) -> "pyarrow.Table":
322323
"""Fetch all (remaining) rows of a query result, returning them as a PyArrow table."""
323324
results=self.results.remaining_rows()
324325
self._next_row_index+=results.num_rows
325-
326+
partial_result_chunks= [results]
326327
whilenotself.has_been_closed_server_sideandself.has_more_rows:
327328
self._fill_results_buffer()
328329
partial_results=self.results.remaining_rows()
@@ -331,7 +332,7 @@ def fetchall_arrow(self) -> "pyarrow.Table":
331332
):
332333
results=self.merge_columnar(results,partial_results)
333334
else:
334-
results=pyarrow.concat_tables([results,partial_results])
335+
partial_result_chunks.append(partial_results)
335336
self._next_row_index+=partial_results.num_rows
336337

337338
# If PyArrow is installed and we have a ColumnTable result, convert it to PyArrow Table
@@ -342,7 +343,7 @@ def fetchall_arrow(self) -> "pyarrow.Table":
342343
forname,colinzip(results.column_names,results.column_table)
343344
}
344345
returnpyarrow.Table.from_pydict(data)
345-
returnresults
346+
returnpyarrow.concat_tables(partial_result_chunks,use_threads=True)
346347

347348
deffetchall_columnar(self):
348349
"""Fetch all (remaining) rows of a query result, returning them as a Columnar table."""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp