I need to figure out how to import CSV files using pre-defined indexed property keys, I tried this:
With a empty Titan graph this code works perfectly
new File("/home/User/titan-server-0.4.2/propnodes.csv").eachLine{ line ->
(BaseRecId,StreetNumber,StreetName,StreetSuffix,City,County,State,Zip) = line.split(",");
prop = g.addVertex("BaseRecId::"+BaseRecId);
ElementHelper.setProperties(prop, ["BaseRecId" : BaseRecId,"StreetNumber": StreetNumber,"StreetName" : StreetName,"StreetSuffix" : StreetSuffix,"City" : City,"County": County,"State" : State,"Zip" : Zip])}
Now, due Titan indexes need to be setup before to populate any data, first step I do this:
g.makeKey('BaseRecId').dataType(Integer.class).indexed('search', Vertex.class).make();
g.makeKey('StreetName').dataType(String.class).indexed('search', Vertex.class).make();
and then when I try to import the data with the above code, and I got this error
An error occurred while processing the script for language [groovy]. All transactions across all graphs in the session have been concluded with failure: javax.script.ScriptException: javax.script.ScriptException: java.lang.NumberFormatException: For input string: "BaseRecId"
How can I import CSV files using existing external indexed property Keys?