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

importer: count how many rows we read #1327

Closed
vagetablechicken opened this issue Feb 25, 2022 · 2 comments · Fixed by #1401
Closed

importer: count how many rows we read #1327

vagetablechicken opened this issue Feb 25, 2022 · 2 comments · Fixed by #1401
Labels
good first issue Good for newcomers

Comments

@vagetablechicken
Copy link
Collaborator

vagetablechicken commented Feb 25, 2022

try {
CSVRecord record;
while ((record = reader.next()) != null) {
Map<Integer, List<Tablet.Dimension>> dims = buildDimensions(record, keyIndexMap, tableMetaData.getPartitionNum());
// distribute the row to the bulk load generators for each MemTable(tid, pid)
for (Integer pid : dims.keySet()) {
// Note: NS pid is int
// no need to calc dims twice, pass it to BulkLoadGenerator
generators.get(pid).feed(new BulkLoadGenerator.FeedItem(dims, tsIdxSet, record));
}
}

We don't know how may rows we read. So count it and print a log.

You can use this logger

private static final Logger logger = LoggerFactory.getLogger(Importer.class);

or System.out.println or any better ways for printing.

@cswjd
Copy link
Contributor

cswjd commented Mar 8, 2022

I would like to help

@Manny-op
Copy link
Contributor

Manny-op commented Mar 8, 2022

I would like to help contribute.

Manny-op added a commit to Manny-op/OpenMLDB that referenced this issue Mar 9, 2022
Issue 4paradigm#1327  attempt fix.
Made integer variable within while loop that reads lines. After loop finishes, uses System.out.println to output the number.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants