Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
{
	"data_source": {			          // required
		"type": "minioMinio", // required, currently only support "minio"/"s3"		          // required
		"address": "localhost:9000",	  // optional, milvus server will use its minio setting if without this value
		"accesskey_id": "minioadmin",	  // optional, milvus server will use its minio setting if without this value
		"accesskey_secret": "minioadmin", // optional, milvus server will use its minio setting if without this value
		"use_ssl": false,		          // optional, milvus server will use its minio setting if without this value
		"bucket_name": "mybucketaaa"		      // optional, milvus server will use its minio setting if without this value
	},

	"internal_data": {		     // optional, external_data or internal_data. (external files include json, npy, etc. internal files are exported by milvus)
		"path": "xxx/xxx/xx",	 // relative path to the source storage where store the exported data
		"collections_mapping": { // optional, give a new name to collection during importing.
			"aaa": "bbb",
				     // field name mapping, key is the source field name, value is the target field name
			"ccc": "ddd"
		}
	},

	"external_data": {			                     // optional, external_data or internal_data. (external files include json, npy, etc. internal files are exported by milvus)
		"target_collection": "xxx",	  // target collection name             // target collection name
		"fileschunks": [ // required
			{
				"file": xxxx/xx.json, // required, relative path under the storage source defined by DataSource, currently support json/npy
				"type": "row_based", // required, row_based or column_based                     // required, chunk list, each chunk can be import as one segment or split into multiple segments
				"fields_mappingfiles": [{	 // optional, specify the target fields which should be imported. Milvus will import all      fields if this list is empty.
					"table.rows.id": "uid", // required, files that provide data of a chunk
					"table.rows.yearpath": "yearxxxx / xx.json",
					"table.rows.vector": "vector",
				}
			},
			{
				"file": xxxx/xx.json, // required,  		 // required, relative path under the storage source defined by DataSource, currently support json/npy
					"type": "columnrow_based",	  		 // required, row_based or column_based
				, tell milvus how to parse this json file
					"fields_mapping": {			     // optional, specify the target fields which should be imported. Milvus will import all fields if this list is empty.
						"table.columnsrows.id": "uid",
					"table.columns.year": "year",
					"table.columns.vector": "vector",
				}
			},
			{
				"file": xxxx/xx.npy, // required, relative path under the storage source defined by DataSource, currently support json/npy
				"type": "column_based", // required, row_based or column_based
				"fields_mapping": { // optional, specify the target fields which should be imported. Milvus will import all fields if this list is empty.
		 // field name mapping, tell milvus how to insert data to correct field, key is a json node path, value is a field name of the collection
						"table.rows.year": "year",
						"table.rows.vector": "vector"
					}
				}]
			},
			{
				"files": [{
					"path": "xxxx / xx.json",
					"type": "column_based",
					"fields_mapping": {
						"table.columns.id": "uid",
						"table.columns.year": "year",
						"table.columns.vector": "vector"
					}
				}]
			},
			{
				"files": [{
					"file": "xxxx / xx.npy",
					"type": "column_based",
					"fields_mapping": {
						"vector": "vector",
					}
				}]
			}
		],
		"default_fields": { // optional, use default value to fill some fields
			"age": 0,
			"weight": 0.0
		},
	}
}


Key fields of the JSON object:

...

Code Block
rpc Import(ImportRequest) returns (MutationResult) {}

message ImportRequest {
  common.MsgBase base = 1;
  string options = 2;
}


message MutationResult {
  common.Status status = 1;
  schema.IDs IDs = 2; // requiredreturn auto-id for insert/import, deleted id for delete
  repeated uint32 succ_index = 3; // errorsucceed indexes indicatefor insert
  repeated uint32 err_index = 4; // error indexes for indicateinsert
  bool acknowledged = 5;
  int64 insert_cnt = 6;
  int64 delete_cnt = 7;
  int64 upsert_cnt = 8;
  uint64 timestamp = 9;
}

...