milvus_cli icon indicating copy to clipboard operation
milvus_cli copied to clipboard

Failed to import data from CLI

Open shanghaikid opened this issue 3 years ago • 3 comments

image

But it can be inserted from insight. image

image

shanghaikid avatar Aug 25 '21 06:08 shanghaikid

import { createObjectCsvWriter as createCsvWriter } from 'csv-writer';

// use to test vector insert
const csvWriter = createCsvWriter({
  path: './vectors.csv',
  header: [
    { id: 'vector', title: 'vector' },
    { id: 'color', title: 'color' },
    { id: 'brand', title: 'brand' },
  ],
});

const records = [];

const generateVector = (dimension) => {
  let index = 0;
  const vectors = [];
  while (index < dimension) {
    vectors.push(1 + Math.random());
    index++;
  }
  return JSON.stringify(vectors);
};

const generateInt = () => {
  return Math.floor(Math.random() * Math.random() * 1000);
};

while (records.length < 50000) {
  const value = generateVector(128);
  records.push({ vector: value, color: generateInt(), brand: generateInt() });
}

csvWriter
  .writeRecords(records) // returns a promise
  .then(() => {
    console.log('...Done');
  });

shanghaikid avatar Aug 25 '21 06:08 shanghaikid

https://github.com/milvus-io/pymilvus-orm/issues/284

czhen-zilliz avatar Aug 26 '21 07:08 czhen-zilliz

https://github.com/milvus-io/pymilvus/issues/667

czhen-zilliz avatar Aug 30 '21 09:08 czhen-zilliz