Skip to content

Commit 4528518

Browse files
review fixes
1 parent f82109d commit 4528518

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

cmapi/cmapi_server/controllers/s3dataload.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,13 @@ def prepare_google_storage(
259259
cpimport_command_line += ['-C', escaped_by]
260260
if enclosed_by:
261261
cpimport_command_line += ['-E', enclosed_by]
262-
if mode is not None and int(mode) in (2, 3):
263-
cpimport_command_line += ['-m', str(int(mode))]
264-
262+
if mode is not None:
263+
try:
264+
mode_val = int(mode)
265+
if mode_val in (2, 3):
266+
cpimport_command_line += ['-m', str(mode_val)]
267+
except (ValueError, TypeError):
268+
module_logger.error(f'Invalid mode value: {mode}')
265269
module_logger.debug(
266270
f'cpimport command line: {" ".join(cpimport_command_line)}'
267271
)

dbcon/mysql/columnstore_info.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ CREATE OR REPLACE PROCEDURE load_from_s3 (in bucket varchar(256) CHARACTER SET u
127127
in terminated_by varchar(256) CHARACTER SET utf8,
128128
in enclosed_by varchar(1) CHARACTER SET utf8,
129129
in escaped_by varchar(1) CHARACTER SET utf8,
130-
in mode int
130+
in mode int DEFAULT 0
131131
)
132132
LANGUAGE SQL
133133
NOT DETERMINISTIC

0 commit comments

Comments
 (0)