Skip to content

Commit

Permalink
move enableDynameField to options
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-HuWei committed Jul 11, 2024
1 parent 5f6c253 commit c74989e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ private void createIndexInternal(TablePath tablePath, List<VectorIndex> vectorIn
.withMetricType(MetricType.valueOf(index.getMetricType()))
.build();

client.createIndex(createIndexParam);
R<RpcStatus> response = client.createIndex(createIndexParam);
if (!Objects.equals(response.getStatus(), R.success().getStatus())) {
throw new MilvusConnectorException(
MilvusConnectionErrorCode.CREATE_INDEX_ERROR, response.getMessage());
}
}
}

Expand Down Expand Up @@ -244,13 +248,12 @@ public void createTableInternal(TablePath tablePath, CatalogTable catalogTable)
CreateCollectionParam createCollectionParam = builder.build();
R<RpcStatus> response = this.client.createCollection(createCollectionParam);
if (!Objects.equals(response.getStatus(), R.success().getStatus())) {
throw new CatalogException(
String.format("Create collection failed, err=%s", response.getMessage()),
response.getException());
throw new MilvusConnectorException(
MilvusConnectionErrorCode.CREATE_COLLECTION_ERROR, response.getMessage());
}
} catch (Exception e) {
throw new CatalogException(
String.format("Failed creating collection %s", tablePath.getFullName()), e);
throw new MilvusConnectorException(
MilvusConnectionErrorCode.CREATE_COLLECTION_ERROR, e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public enum MilvusConnectionErrorCode implements SeaTunnelErrorCode {
CLOSE_CLIENT_ERROR("MILVUS-11", "Close client error"),
DESC_INDEX_ERROR("MILVUS-12", "Desc index error"),
CREATE_DATABASE_ERROR("MILVUS-13", "Create database error"),
CREATE_COLLECTION_ERROR("MILVUS-14", "Create collection error"),
CREATE_INDEX_ERROR("MILVUS-15", "Create index error"),
;

private final String code;
Expand Down

0 comments on commit c74989e

Please sign in to comment.