Skip to content

Commit 51d85a7

Browse files
committed
TEMPORARY TABLE is evil
in practice, we will probably not see issues with this unless we get some insanely large file to process, but with recent issues, i think this prudent.
1 parent 2482b6a commit 51d85a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/acquisition/covidcast/database.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def insert_or_update_batch(self, cc_rows, batch_size=2**20, commit_partial=False
108108

109109
# TODO: this heavily copypastas src/ddl/covidcast.sql -- theres got to be a better way
110110
create_tmp_table_sql = f'''
111-
CREATE TEMPORARY TABLE `{tmp_table_name}` (
111+
CREATE TABLE `{tmp_table_name}` (
112112
`source` varchar(32) NOT NULL,
113113
`signal` varchar(64) NOT NULL,
114114
`time_type` varchar(12) NOT NULL,
@@ -129,7 +129,7 @@ def insert_or_update_batch(self, cc_rows, batch_size=2**20, commit_partial=False
129129
'''
130130

131131
truncate_tmp_table_sql = f'TRUNCATE TABLE {tmp_table_name};'
132-
drop_tmp_table_sql = f'DROP TEMPORARY TABLE {tmp_table_name}'
132+
drop_tmp_table_sql = f'DROP TABLE {tmp_table_name}'
133133

134134
insert_into_tmp_sql = f'''
135135
INSERT INTO `{tmp_table_name}`

0 commit comments

Comments
 (0)