Skip to content
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

Closed
wants to merge 21 commits into from

Conversation

liugddx
Copy link
Member

@liugddx liugddx commented Jun 5, 2023

Purpose of this pull request

Check list

@liugddx liugddx marked this pull request as draft June 5, 2023 08:54
@liugddx
Copy link
Member Author

liugddx commented Jun 7, 2023

image

By https://platform.openai.com/docs/api-reference/embeddings vectorizing the book title to store the database

@liugddx liugddx marked this pull request as ready for review June 13, 2023 03:14
@liugddx liugddx changed the title [WIP][Feature][Connector-V2] Introduce milvus connector [Feature][Connector-V2] Introduce milvus connector Jun 13, 2023
@liugddx
Copy link
Member Author

liugddx commented Jun 13, 2023

@EricJoy2048 @hailin0 @Hisoka-X PTAL

@hailin0
Copy link
Member

hailin0 commented Jul 20, 2023

good

Comment on lines +55 to +62
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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test all support datatypes?

Copy link
Member Author

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

@liugddx liugddx changed the title [Feature][Connector-V2] Introduce milvus connector [Feature][Connector-V2] Introduce milvus sink connector Jul 20, 2023
ic4y
ic4y previously approved these changes Aug 5, 2023
@@ -0,0 +1,85 @@
# Milvus
Copy link
Member

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

Comment on lines 48 to 60
```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
}
```
Copy link
Member

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.

Comment on lines 41 to 66
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());
}
}
Copy link
Member

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.

Comment on lines 57 to 62
CheckResult result =
CheckConfigUtil.checkAllExists(
pluginConfig,
MilvusConfig.MILVUS_HOST.key(),
MilvusConfig.MILVUS_PORT.key(),
MilvusConfig.COLLECTION_NAME.key());
Copy link
Member

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());

@liugddx liugddx closed this Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants