Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Fix CSV scanner for handling filter predicate on a VARCHAR column correctly #1490

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
5 changes: 4 additions & 1 deletion src/codegen/util/csv_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ void CSVScanner::ProduceCSV(char *line) {
cols_[col_idx].len = static_cast<uint32_t>(col_end - col_begin);
cols_[col_idx].is_null = (cols_[col_idx].len == 0);

// Yoon-Min: replace delimiter to '\0' to fix a bug while comparing
// filter condition in a query and column value of VARCHAR type
*iter = 0;
// Eat delimiter, moving to next column
iter++;
}
Expand All @@ -372,4 +375,4 @@ void CSVScanner::ProduceCSV(char *line) {

} // namespace util
} // namespace codegen
} // namespace peloton
} // namespace peloton