@@ -96,6 +96,10 @@ void ExternalPattern::getMatchingInit(const vector<tuple<string, vector<Types>>>
9696
9797 bool created = fs::create_directory (this ->fp_tmpdir_ );
9898
99+ if (!created) {
100+ std::cerr << " WARNING: temporary directory " << this ->fp_tmpdir_ << " could not be created." ;
101+ }
102+
99103 fs::permissions (this ->fp_tmpdir_ , fs::perms::all);
100104
101105 // create a path to store matching files
@@ -164,17 +168,15 @@ vector<Tuple> ExternalPattern::getMatchingBlock(){
164168void ExternalPattern::groupByHelper (){
165169
166170 std::vector<std::pair<std::vector<std::pair<std::string, Types>> , std::vector<Tuple>>> temp_group;
167- int group_idx;
171+
168172 vector<Tuple> temp_vec;
169173 vector<std::pair<std::string, Types>> grouped_variables;
170174 string group_by;
171175 // for(const auto& group_by: this->group){
172176
173- for (int j = 1 ; j < this ->group_ .size (); ++j){
177+ for (unsigned int j = 1 ; j < this ->group_ .size (); ++j){
174178 group_by = this ->group_ [j];
175179
176- group_idx = 0 ;
177-
178180 for (auto & vec: this ->current_group_ ){
179181
180182
@@ -189,7 +191,7 @@ void ExternalPattern::groupByHelper(){
189191
190192 Types current_value = get<0 >(vec.second [0 ])[group_by]; // get the value of variable
191193 vector<Tuple> empty_vec;
192- int i = 0 ;
194+ unsigned int i = 0 ;
193195 int group_ptr = 0 ;
194196
195197 // group files into vectors based on group_by variable
@@ -421,7 +423,7 @@ void ExternalPattern::sortFiles(){
421423
422424}
423425
424- Tuple ExternalPattern::getItem (int key){
426+ Tuple ExternalPattern::getItem (unsigned int key){
425427
426428 if (key < 0 ) {
427429 if (this ->stream_ .getValidFilesSize () + key < 0 ) throw out_of_range (" Index " + std::to_string (key) + " is out of range." );
@@ -459,18 +461,18 @@ vector<Tuple> ExternalPattern::getSlice(vector<Types>& key){
459461 string key2 = s::to_string (key[2 ]);
460462
461463 if (s::is_number (key0) && key1 == " None" && key2 == " None" ){
462- int i = stoi (key0);
464+ unsigned int i = stoi (key0);
463465
464466 if (i >= this ->stream_ .getValidFilesSize ()) throw out_of_range (" Index " + std::to_string (i) + " is out of range." );
465- int j = this ->stream_ .getValidFilesSize ();
466- int step = 1 ;
467+ unsigned int j = this ->stream_ .getValidFilesSize ();
468+ unsigned int step = 1 ;
467469 return this ->stream_ .getValidFilesSlice (i, j, step);
468470 }
469471
470472 // A start and stop index is provided with no step size, i.e. valid_files[i:j]
471473 if (s::is_number (key0) && s::is_number (key1) && key2 == " None" ){
472- int i = stoi (key0);
473- int j = stoi (key1);
474+ unsigned int i = stoi (key0);
475+ unsigned int j = stoi (key1);
474476
475477 if (i > this ->stream_ .getValidFilesSize ()) throw out_of_range (" Index " + std::to_string (i) + " is out of range." );
476478 if (j > this ->stream_ .getValidFilesSize ()) throw out_of_range (" Index " + std::to_string (j) + " is out of range." );
@@ -483,8 +485,8 @@ vector<Tuple> ExternalPattern::getSlice(vector<Types>& key){
483485
484486 // A start, stop, and step is provided
485487 if (s::is_number (key0) && s::is_number (key1) && s::is_number (key2)){
486- int i = stoi (key0);
487- int j = stoi (key1);
488+ unsigned int i = stoi (key0);
489+ unsigned int j = stoi (key1);
488490
489491 if (i > this ->stream_ .getValidFilesSize ()) throw out_of_range (" Index " + std::to_string (i) + " is out of range." );
490492 if (j > this ->stream_ .getValidFilesSize ()) throw out_of_range (" Index " + std::to_string (j) + " is out of range." );
@@ -494,10 +496,10 @@ vector<Tuple> ExternalPattern::getSlice(vector<Types>& key){
494496 }
495497
496498 if (s::is_number (key0) && key1 == " None" && s::is_number (key2)){
497- int i = stoi (key0);
499+ unsigned int i = stoi (key0);
498500 if (i > this ->stream_ .getValidFilesSize ()) throw out_of_range (" Index " + std::to_string (i) + " is out of range." );
499501
500- int j = this ->stream_ .getValidFilesSize ();
502+ unsigned int j = this ->stream_ .getValidFilesSize ();
501503 int step = stoi (key2);
502504 return this ->stream_ .getValidFilesSlice (i, j, step);
503505 }
0 commit comments