@@ -206,15 +206,18 @@ public void executeCopy(String hostPort, String fileName) throws IOException{
206206 if (success ){
207207 LOG .info ("commit success cost {}ms, response is {}, filename is {}" , System .currentTimeMillis () - start , loadResult ,fileName );
208208 }else {
209- throw new SelectdbWriterException ("commit fail" ,true );
209+ LOG .error ("commit error with status {}, reason {}, response {}" , statusCode , reasonPhrase , loadResult );
210+ String copyErrMsg = String .format ("commit error, status: %d, reason: %s, response: %s, copySQL: %s" ,
211+ statusCode , reasonPhrase , loadResult , copySQL );
212+ throw new SelectdbWriterException (copyErrMsg ,true );
210213 }
211214 }
212215 }
213216
214217 public boolean handleCommitResponse (String loadResult ) throws IOException {
215- BaseResponse < CopyIntoResp > baseResponse = OBJECT_MAPPER .readValue (loadResult , new TypeReference <BaseResponse < CopyIntoResp > >(){});
218+ BaseResponse baseResponse = OBJECT_MAPPER .readValue (loadResult , new TypeReference <BaseResponse >(){});
216219 if (baseResponse .getCode () == SUCCESS ){
217- CopyIntoResp dataResp = baseResponse .getData ();
220+ CopyIntoResp dataResp = OBJECT_MAPPER . convertValue ( baseResponse .getData (), CopyIntoResp . class );
218221 if (FAIL .equals (dataResp .getDataCode ())){
219222 LOG .error ("copy into execute failed, reason:{}" , loadResult );
220223 return false ;
0 commit comments