Skip to content

Commit

Permalink
Null disturbance type handling for ClickHouse.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfellows committed Jun 3, 2024
1 parent 19b5357 commit 0f15f3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/moja.modules.cbm/src/flatrecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace cbm {

std::string FlatFluxRecord::asPersistable(bool csvFormat) const {
static const std::string csvRecord = "%1%,%2%,%3%,%4%,%5%,%6%,%7%,\"%8%\",%9%,%10%,%11%,%12%\n";
static const std::string dbRecord = "%1%,%2%,'%3%','%4%',%5%,'%6%','%7%','%8%',%9%,'%10%','%11%',%12%";
static const std::string dbRecord = "%1%,%2%,'%3%','%4%',%5%,'%6%','%7%',%8%,%9%,'%10%','%11%',%12%";

auto classifierStr = FlatRecordHelper::BuildClassifierValueString(_classifierValues, csvFormat);
auto previousClassifierStr = FlatRecordHelper::BuildClassifierValueString(_previousClassifierValues, csvFormat);
Expand All @@ -125,7 +125,7 @@ namespace cbm {
} else {
return (boost::format(dbRecord)
% _year % classifierStr % _landClass % _ageClass % previousClassifierStr % _previousLandClass
% _previousAgeClass % (_disturbanceType.isNull() || _disturbanceType == "" ? "NULL" : _disturbanceType.value())
% _previousAgeClass % (_disturbanceType.isNull() || _disturbanceType == "" ? "NULL" : ((boost::format("'%1%'") % _disturbanceType.value()).str()))
% (_disturbanceCode.isNull() ? "NULL" : pqxx::to_string(_disturbanceCode.value()))
% _srcPool % _dstPool % _flux).str();
}
Expand Down

0 comments on commit 0f15f3d

Please sign in to comment.