Search in sources :

Example 6 with FileSetting

use of com.baidu.hugegraph.entity.load.FileSetting in project incubator-hugegraph-toolchain by apache.

the class FileMappingController method checkMappingValid.

private void checkMappingValid(ElementMapping elementMapping, FileMapping fileMapping) {
    FileSetting fileSetting = fileMapping.getFileSetting();
    List<String> columnNames = fileSetting.getColumnNames();
    if (elementMapping.getFieldMappings() != null) {
        Set<String> keys = elementMapping.fieldMappingToMap().keySet();
        Ex.check(columnNames.containsAll(keys), "load.file-mapping.field.keys-should-in-column-names");
    }
    if (elementMapping.getValueMappings() != null) {
        Set<String> keys = elementMapping.valueMappingToMap().keySet();
        Ex.check(columnNames.containsAll(keys), "load.file-mapping.value.keys-should-in-column-names");
    }
}
Also used : FileSetting(com.baidu.hugegraph.entity.load.FileSetting)

Aggregations

FileSetting (com.baidu.hugegraph.entity.load.FileSetting)6 VertexLabelEntity (com.baidu.hugegraph.entity.schema.VertexLabelEntity)2 FileMapping (com.baidu.hugegraph.entity.load.FileMapping)1 ListFormat (com.baidu.hugegraph.entity.load.ListFormat)1 EdgeLabelEntity (com.baidu.hugegraph.entity.schema.EdgeLabelEntity)1 ExternalException (com.baidu.hugegraph.exception.ExternalException)1 InternalException (com.baidu.hugegraph.exception.InternalException)1 FileSource (com.baidu.hugegraph.loader.source.file.FileSource)1 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 FileReader (java.io.FileReader)1 IOException (java.io.IOException)1 Pattern (java.util.regex.Pattern)1 PostMapping (org.springframework.web.bind.annotation.PostMapping)1 MultipartFile (org.springframework.web.multipart.MultipartFile)1