Supports importing bitmap and other types

This commit is contained in:
caoliang 2024-01-11 12:28:30 +08:00
parent ad7a0cce6b
commit 329f7b28cf
2 changed files with 7 additions and 2 deletions

View File

@ -40,7 +40,7 @@ public class SelectdbCopyIntoObserver {
private CloseableHttpClient httpClient; private CloseableHttpClient httpClient;
private static final String UPLOAD_URL_PATTERN = "%s/copy/upload"; private static final String UPLOAD_URL_PATTERN = "%s/copy/upload";
private static final String COMMIT_PATTERN = "%s/copy/query"; private static final String COMMIT_PATTERN = "%s/copy/query";
private static final Pattern COMMITTED_PATTERN = Pattern.compile("errCode = 2, detailMessage = No files can be copied, matched (\\d+) files, " + "filtered (\\d+) files because files may be loading or loaded"); private static final Pattern COMMITTED_PATTERN = Pattern.compile("errCode = 2, detailMessage = No files can be copied.*");
public SelectdbCopyIntoObserver(Keys options) { public SelectdbCopyIntoObserver(Keys options) {
@ -202,7 +202,7 @@ public class SelectdbCopyIntoObserver {
return false; return false;
}else{ }else{
Map<String, String> result = dataResp.getResult(); Map<String, String> result = dataResp.getResult();
if(!result.get("state").equals("FINISHED") && !isCommitted(result.get("msg"))){ if(SelectdbUtil.isNullOrEmpty(result) || !result.get("state").equals("FINISHED") && !isCommitted(result.get("msg"))){
LOG.error("copy into load failed, reason:{}", loadResult); LOG.error("copy into load failed, reason:{}", loadResult);
return false; return false;
}else{ }else{

View File

@ -15,6 +15,7 @@ import java.sql.Statement;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* jdbc util * jdbc util
@ -110,4 +111,8 @@ public class SelectdbUtil {
return reference; return reference;
} }
} }
public static boolean isNullOrEmpty(Map<?, ?> map) {
return map == null || map.isEmpty();
}
} }