Skip to content

Commit

Permalink
Support the dynamic column
Browse files Browse the repository at this point in the history
Signed-off-by: SimFG <[email protected]>
  • Loading branch information
SimFG committed Nov 29, 2023
1 parent d1df1d6 commit 8b794f7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
"github.com/milvus-io/milvus-sdk-go/v2/entity"
)

const MetaFieldName = "$meta"

// Insert Index into collection with column-based format
// collName is the collection name
// partitionName is the partition to insert, if not specified(empty), default partition will be used
Expand Down Expand Up @@ -159,6 +161,12 @@ func (c *GrpcClient) processInsertColumns(colSchema *entity.Schema, columns ...e
}

func (c *GrpcClient) mergeDynamicColumns(dynamicName string, rowSize int, columns []entity.Column) (*schemapb.FieldData, error) {
if len(columns) == 1 && columns[0].Name() == MetaFieldName {
data := columns[0].FieldData()
data.FieldName = dynamicName
return data, nil

Check warning on line 167 in client/insert.go

View check run for this annotation

Codecov / codecov/patch

client/insert.go#L165-L167

Added lines #L165 - L167 were not covered by tests
}

values := make([][]byte, 0, rowSize)
for i := 0; i < rowSize; i++ {
m := make(map[string]interface{})
Expand Down

0 comments on commit 8b794f7

Please sign in to comment.