mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-01-26 15:36:33 -06:00
Merge pull request #295 from nosqlbench/csv-parser-bug
Use CSVFormat.Default to handle rfc4180 CSVs
This commit is contained in:
commit
1af1d18e5e
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
@ -162,6 +162,7 @@ jobs:
|
|||||||
run: scripts/release-perform.sh
|
run: scripts/release-perform.sh
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
env:
|
env:
|
||||||
|
RELEASE_BRANCH_PATTERN: "release"
|
||||||
RELEASE_BRANCH_NAME: "main"
|
RELEASE_BRANCH_NAME: "main"
|
||||||
GIT_RELEASE_BOT_NAME: "nb-droid"
|
GIT_RELEASE_BOT_NAME: "nb-droid"
|
||||||
GIT_RELEASE_BOT_EMAIL: ${{ secrets.GIT_RELEASE_BOT_EMAIL }}
|
GIT_RELEASE_BOT_EMAIL: ${{ secrets.GIT_RELEASE_BOT_EMAIL }}
|
||||||
|
@ -65,7 +65,7 @@ public class NBIO implements NBPathsAPI.Facets {
|
|||||||
|
|
||||||
public static CSVParser readFileDelimCSV(String filename,char delim, String... searchPaths) {
|
public static CSVParser readFileDelimCSV(String filename,char delim, String... searchPaths) {
|
||||||
Reader reader = NBIO.readReader(filename, searchPaths);
|
Reader reader = NBIO.readReader(filename, searchPaths);
|
||||||
CSVFormat format = CSVFormat.newFormat(delim).withFirstRecordAsHeader();
|
CSVFormat format = CSVFormat.DEFAULT.withDelimiter(delim).withFirstRecordAsHeader();
|
||||||
try {
|
try {
|
||||||
CSVParser parser = new CSVParser(reader, format);
|
CSVParser parser = new CSVParser(reader, format);
|
||||||
return parser;
|
return parser;
|
||||||
|
@ -80,7 +80,9 @@ public class WeightedStringsFromCSV implements LongFunction<String> {
|
|||||||
String value = csvdatum.get(valueColumn);
|
String value = csvdatum.get(valueColumn);
|
||||||
values.add(value);
|
values.add(value);
|
||||||
String weight = csvdatum.get(weightColumn);
|
String weight = csvdatum.get(weightColumn);
|
||||||
events.add(new EvProbD(values.size() - 1, Double.valueOf(weight)));
|
if(!weight.isEmpty()) {
|
||||||
|
events.add(new EvProbD(values.size() - 1, Double.valueOf(weight)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user