I need to upload a .csv file and save the record in the bigtable. My application successfully parses 200 records in CSV files and saves in the table.
My code is for saving data. For the
(int i = 0; i & lt; lines.length -1; i ++) // records the total records in the CSV file {string line = lines [i]; // record contains 3 columns integer, integer, text if (line.length ()> 15) {int n = line.indexOf (","); If (n> gt;) {int id = lInteger.parseInt (ine.substring (0, n)); Int n1 = line.indexOf (",", n + 2); If (n1> n) {int Col1 = integer. PRIIST (line bustring (N + 1, N1)); String call 2 = line substring (n1 + 1); MyTable U = new myTable (); Uu.setId (id); Uu.setCol1 (MobNo); Text t = new text (call2); Uu.setCol2 (t); Stability Manager = pmf.get () GetPersistenceManager (); Pm.makePersistent (UU); Pm.close (); }}}}
But when there is no increase in the record, it receives the timeout error.
There may be up to 800 records in the CSV file, is it possible to do this in app engine?
(something like a batch update)
, And you can not run a long task.
The best way is to divide the CSV into smaller parts, and process them one by one each by one. In case you can only upload it as a large file, you can store it as binary data, and then use the process (partition and parse) (note that this copy The request is limited to 10 minutes, but you can always create a series of tasks) or you can backend the user to process.
Comments
Post a Comment