src/InferTypesHandler.h
branchv_0
changeset 9 215f62cc655f
parent 4 66c8a1783884
equal deleted inserted replaced
8:fc8b94bccfc5 9:215f62cc655f
    73 		// TODO: move this logic to relpipe-lib-infertypes and share with certain modules like relpipe-in-csv
    73 		// TODO: move this logic to relpipe-lib-infertypes and share with certain modules like relpipe-in-csv
    74 		currentMode.reset();
    74 		currentMode.reset();
    75 		for (RelationConfiguration rc : configuration.relationConfigurations) {
    75 		for (RelationConfiguration rc : configuration.relationConfigurations) {
    76 			if (std::regex_match(name, rc.relationPattern)) {
    76 			if (std::regex_match(name, rc.relationPattern)) {
    77 				if (rc.mode == MODE::METADATA || rc.mode == MODE::AUTO && MetadataMode::willInfer(attributes)) currentMode.reset(new MetadataMode(relationalWriter));
    77 				if (rc.mode == MODE::METADATA || rc.mode == MODE::AUTO && MetadataMode::willInfer(attributes)) currentMode.reset(new MetadataMode(relationalWriter));
    78 				else if (rc.mode == MODE::DATA) currentMode.reset(new DataMode(relationalWriter));
    78 				else if (rc.mode == MODE::DATA || rc.mode == MODE::AUTO) currentMode.reset(new DataMode(relationalWriter));
    79 				else throw std::logic_error("Unsupported mode: " + std::to_string((int) rc.mode));
    79 				else throw std::logic_error("Unsupported mode: " + std::to_string((int) rc.mode));
    80 				break;
    80 				break;
    81 			}
    81 			}
    82 		}
    82 		}
    83 
    83