Commit 803c0e2
authored
Fix BaseSQLToGCSOperator approx_max_file_size_bytes (#25469)
* Fix BaseSQLToGCSOperator approx_max_file_size_bytes
When using the parquet file_format, using `tmp_file_handle.tell()`
always points to the beginning of the file after the data has been saved
and therefore is not a good indicator for the files current size.
Save the current file pointer position and set the file pointer position
to `os.SEEK_END`. file_size is set to the new position, and the file
pointer's position goes back to the saved position.
Currently, after a parquet write operation the pointer is set to 0,
and therefore, simply executing `tmp_file_handle.tell()` is not
sufficient to determine the current size. This sequence is added to
allow file splitting when the export format is set to parquet.1 parent d004841 commit 803c0e2
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| |||
250 | 252 | | |
251 | 253 | | |
252 | 254 | | |
253 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
254 | 261 | | |
255 | 262 | | |
256 | 263 | | |
| |||
0 commit comments