Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wudi committed Nov 29, 2023
1 parent 734662e commit 8886427
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ public String visit(CharType charType) {

@Override
public String visit(VarCharType varCharType) {
int length = varCharType.getLength();
return length * 4 > 65533 ? STRING : String.format("%s(%s)", VARCHAR, length * 4);
//Flink varchar length max value is int, it may overflow after multiplying by 4
long length = varCharType.getLength();
return length * 4 >= 65533 ? STRING : String.format("%s(%s)", VARCHAR, length * 4);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ public static Schema getSchema(DorisOptions options, DorisReadOptions readOption

public static boolean isUniqueKeyType(DorisOptions options, DorisReadOptions readOptions, Logger logger)
throws DorisRuntimeException {
//Enable 2pc in multi-table scenario
//disable 2pc in multi-table scenario
if(StringUtils.isBlank(options.getTableIdentifier())){
logger.info("table model verification is skipped in multi-table scenarios.");
return false;
return true;
}
try {
return UNIQUE_KEYS_TYPE.equals(getSchema(options, readOptions, logger).getKeysType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public boolean execute(String ddl, String database) throws IOException, IllegalA
if(StringUtils.isNullOrWhitespaceOnly(ddl)){
return false;
}
LOG.info("Execute SQL: {}", ddl);
Map<String, String> param = new HashMap<>();
param.put("stmt", ddl);
String requestUrl = String.format(SCHEMA_CHANGE_API,
Expand Down

0 comments on commit 8886427

Please sign in to comment.