-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature][Connector-V2] Introduce milvus sink connector #4885
Conversation
By https://platform.openai.com/docs/api-reference/embeddings vectorizing the book title to store the database |
good |
c_int = int | ||
c_array = array<float> | ||
c_tinyint = tinyint | ||
c_smallint = smallint | ||
c_bigint = bigint | ||
c_float = float | ||
c_double = double | ||
c_bol = "boolean" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test all support datatypes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test all support datatypes?
Milvus currently supports these data types.
https://milvus.io/docs/schema.md#Supported-data-type
docs/en/connector-v2/sink/Milvus.md
Outdated
@@ -0,0 +1,85 @@ | |||
# Milvus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use new document template, like #5132
docs/en/connector-v2/sink/Milvus.md
Outdated
```hocon | ||
sink { | ||
Milvus { | ||
milvus_host = localhost | ||
milvus_port = 19530 | ||
username = root | ||
password = Milvus | ||
collection_name = title_db | ||
openai_engine = text-embedding-ada-002 | ||
openai_api_key = sk-xxxx | ||
embeddings_fields = title_2 | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should put a demo can run without any modify. Not just sink config. It's more useful.
public MilvusOptions(Config config) { | ||
this.milvusHost = config.getString(MilvusConfig.MILVUS_HOST.key()); | ||
if (config.hasPath(MilvusConfig.MILVUS_PORT.key())) { | ||
this.milvusPort = config.getInt(MilvusConfig.MILVUS_PORT.key()); | ||
} else { | ||
this.milvusPort = MilvusConfig.MILVUS_PORT.defaultValue(); | ||
} | ||
this.collectionName = config.getString(MilvusConfig.COLLECTION_NAME.key()); | ||
this.userName = config.getString(MilvusConfig.USERNAME.key()); | ||
this.password = config.getString(MilvusConfig.PASSWORD.key()); | ||
|
||
if (config.hasPath(MilvusConfig.PARTITION_FIELD.key())) { | ||
this.partitionField = config.getString(MilvusConfig.PARTITION_FIELD.key()); | ||
} | ||
if (config.hasPath(MilvusConfig.OPENAI_ENGINE.key())) { | ||
this.openaiEngine = config.getString(MilvusConfig.OPENAI_ENGINE.key()); | ||
} else { | ||
this.openaiEngine = MilvusConfig.OPENAI_ENGINE.defaultValue(); | ||
} | ||
if (config.hasPath(MilvusConfig.OPENAI_API_KEY.key())) { | ||
this.openaiApiKey = config.getString(MilvusConfig.OPENAI_API_KEY.key()); | ||
} | ||
if (config.hasPath(MilvusConfig.EMBEDDINGS_FIELDS.key())) { | ||
this.embeddingsFields = config.getString(MilvusConfig.EMBEDDINGS_FIELDS.key()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use ReadonlyConfig readonlyConfig = ReadonlyConfig.fromConfig(config);
. Then just use readonlyConfig.get(MilvusConfig.MILVUS_HOST)
, it will hande default value.
CheckResult result = | ||
CheckConfigUtil.checkAllExists( | ||
pluginConfig, | ||
MilvusConfig.MILVUS_HOST.key(), | ||
MilvusConfig.MILVUS_PORT.key(), | ||
MilvusConfig.COLLECTION_NAME.key()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use OptionRule to check config is valid or not.
eg:
ConfigValidator.of(config).validate(new JdbcSourceFactory().optionRule());
Purpose of this pull request
Check list
New License Guide
release-note
.