@@ -28,6 +28,7 @@ class CommonArgParser {
2828 std::map<std::string, std::set<std::string>> excludeValueFilters;
2929 std::map<std::string, std::set<std::string>> allowedValues;
3030 std::set<std::string> notEmptyColumns;
31+ std::set<std::string> notNullColumns;
3132 bool removeEmptyJson;
3233 bool removeErrors;
3334 int tailLines; // --tail <n>: only read last n lines from each file
@@ -117,15 +118,25 @@ class CommonArgParser {
117118 std::cerr << " Error: --not-empty requires an argument" << std::endl;
118119 return false ;
119120 }
121+ } else if (arg == " --not-null" ) {
122+ if (i + 1 < argc) {
123+ ++i;
124+ notNullColumns.insert (argv[i]);
125+ } else {
126+ std::cerr << " Error: --not-null requires an argument" << std::endl;
127+ return false ;
128+ }
120129 } else if (arg == " --remove-empty-json" ) {
121130 removeEmptyJson = true ;
122131 } else if (arg == " --remove-errors" ) {
123132 removeErrors = true ;
124133 } else if (arg == " --clean" ) {
125- // --clean expands to --remove-empty-json --not-empty value --remove-errors
134+ // --clean expands to --remove-empty-json --not-empty value --remove-errors --not-null value --not-null sensor_id
126135 removeEmptyJson = true ;
127136 notEmptyColumns.insert (" value" );
128137 removeErrors = true ;
138+ notNullColumns.insert (" value" );
139+ notNullColumns.insert (" sensor_id" );
129140 } else if (arg == " --only-value" ) {
130141 if (i + 1 < argc) {
131142 ++i;
@@ -279,6 +290,7 @@ class CommonArgParser {
279290 const std::map<std::string, std::set<std::string>>& getExcludeValueFilters () const { return excludeValueFilters; }
280291 const std::map<std::string, std::set<std::string>>& getAllowedValues () const { return allowedValues; }
281292 const std::set<std::string>& getNotEmptyColumns () const { return notEmptyColumns; }
293+ const std::set<std::string>& getNotNullColumns () const { return notNullColumns; }
282294 bool getRemoveEmptyJson () const { return removeEmptyJson; }
283295 bool getRemoveErrors () const { return removeErrors; }
284296 int getTailLines () const { return tailLines; }
@@ -302,15 +314,15 @@ class CommonArgParser {
302314
303315 // Common filtering options
304316 static const std::set<std::string> filterOptions = {
305- " --not-empty" , " --only-value" , " --exclude-value" , " --allowed-values" ,
317+ " --not-empty" , " --not-null " , " -- only-value" , " --exclude-value" , " --allowed-values" ,
306318 " --remove-errors" , " --remove-empty-json" , " --clean"
307319 };
308320
309321 // Options that take arguments (need to skip the next arg)
310322 // Note: --allowed-values takes TWO args but we handle that specially
311323 static const std::set<std::string> optionsWithArgs = {
312324 " -if" , " --input-format" , " -e" , " --extension" , " -d" , " --depth" ,
313- " --min-date" , " --max-date" , " --not-empty" , " --only-value" ,
325+ " --min-date" , " --max-date" , " --not-empty" , " --not-null " , " -- only-value" ,
314326 " --exclude-value" , " --allowed-values" , " -o" , " --output" , " -of" , " --output-format" ,
315327 " -c" , " --column" , " --tail"
316328 };
0 commit comments