Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Keenan G <41458184+Riolku@users.noreply.github.com>
  • Loading branch information
andyfengHKU and Riolku committed Oct 14, 2023
1 parent c7f1604 commit 37e51ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/binder/bind/bind_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,9 @@ expression_vector Binder::bindExpectedNodeFileColumns(
switch (readerConfig.fileType) {
case FileType::TURTLE: {
auto stringType = LogicalType{LogicalTypeID::STRING};
expectedColumnNames = std::vector<std::string>{
expectedColumnNames = {
std::string(RDF_SUBJECT), std::string(RDF_PREDICATE), std::string(RDF_OBJECT)};
for (auto& _ : expectedColumnNames) {
expectedColumnTypes.push_back(stringType.copy());
}
expectedColumnTypes = {stringType.copy(), stringType.copy(), stringType.copy()};
} break;
case FileType::NPY:
case FileType::PARQUET:
Expand Down
8 changes: 6 additions & 2 deletions src/binder/bind/bind_reading_clause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void Binder::validateColumnTypes(const std::vector<std::string>& columnNames,
for (auto i = 0; i < expectedColumnTypes.size(); ++i) {
if (*expectedColumnTypes[i] != *detectedColumnTypes[i]) {
throw BinderException(
StringUtils::string_format("Column {} type mismatch. Expect {} but get {}.",
StringUtils::string_format("Column {} type mismatch. Expected {} but got {}.",
columnNames[i], LogicalTypeUtils::dataTypeToString(*expectedColumnTypes[i]),
LogicalTypeUtils::dataTypeToString(*detectedColumnTypes[i])));
}
Expand Down Expand Up @@ -230,8 +230,12 @@ void Binder::sniffFiles(const common::ReaderConfig& readerConfig,
columnNames.push_back(tmpColumnNames[0]);
columnTypes.push_back(tmpColumnTypes[0]->copy());
} break;
case FileType::TURTLE:
break
default:
break;
// LCOV_EXCL_START
throw NotImplementedException("Binder::sniffFiles");
// LCOV_EXCL_END
}
}
}
Expand Down

0 comments on commit 37e51ea

Please sign in to comment.