File tree Expand file tree Collapse file tree
cmapi/cmapi_server/controllers Expand file tree Collapse file tree Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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 )
132132LANGUAGE SQL
133133NOT DETERMINISTIC
You can’t perform that action at this time.
0 commit comments