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

Commit4d4734a

Browse files
committed
Use copy_from from psycopg2 for TPC-DS data load
1 parent087b0c8 commit4d4734a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎tests/prepare_stress.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ rm -rf ./*
66

77
git clone --depth 1 --single-branch --branch master https://github.com/gregrahn/tpcds-kit.git
88
git clone --depth 1 --single-branch --branch master https://github.com/cwida/tpcds-result-reproduction.git
9+
910
cd tpcds-kit/tools
1011
make -s
1112

‎tests/test_cases.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,10 @@ def load_tpcds_data(config):
542542
fortable_datafileinos.listdir('tmp_stress/tpcds-kit/tools/'):
543543
iftable_datafile.endswith('.dat'):
544544
table_name=os.path.splitext(os.path.basename(table_datafile))[0]
545-
copy_cmd="COPY %s FROM '/pg/testdir/tmp_stress/tpcds-kit/tools/tables/%s' CSV DELIMITER '|'"% (table_name,table_datafile)
546545

547546
print('Loading table',table_name)
548-
# cur.execute("TRUNCATE %s" %table_name)
549-
cur.execute(copy_cmd)
547+
withopen('tmp_stress/tpcds-kit/tools/tables/%s'%table_datafile)asf:
548+
cur.copy_from(f,table_name,sep='|',null='')
550549

551550
conn.commit()
552551

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp