Minor changes to print the Sarc keys

This commit is contained in:
Spyros Zoupanos 2020-09-15 18:08:42 +03:00
parent ba33df29b4
commit 8bb00add0d
1 changed files with 14 additions and 3 deletions

View File

@ -11,6 +11,7 @@ import java.sql.ResultSet;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Set;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
@ -63,7 +64,8 @@ public class SarcStats {
}
public void processSarc(String sarcsReportPath) throws Exception {
processARReport(sarcsReportPath, "https://revistas.rcaap.pt/motricidade/sushiLite/v1_7/", "1646-107X");
// There was a problem to download the following file
// processARReport(sarcsReportPath, "https://revistas.rcaap.pt/motricidade/sushiLite/v1_7/", "1646-107X");
processARReport(sarcsReportPath, "https://revistas.rcaap.pt/antropologicas/sushiLite/v1_7/", "0873-819X");
processARReport(sarcsReportPath, "https://revistas.rcaap.pt/interaccoes/sushiLite/v1_7/", "1646-2335");
processARReport(sarcsReportPath, "https://revistas.rcaap.pt/cct/sushiLite/v1_7/", "2182-3030");
@ -185,6 +187,15 @@ public class SarcStats {
for (Object aJsonArray : jsonArray) {
JSONObject jsonObjectRow = (JSONObject) aJsonArray;
Set<String> jkeys = jsonObjectRow.keySet();
for (String jkey : jkeys) {
System.out.println("++++> " + jkey);
String[] splitArray = jkey.split("c:");
jkey = splitArray[splitArray.length - 1];
System.out.println("New jkey: " + jkey);
}
fin.write(jsonObjectRow.toJSONString().getBytes());
fin.writeChar('\n');
}
@ -243,8 +254,8 @@ public class SarcStats {
// break;
}
// preparedStatement.executeBatch();
// ConnectDB.getConnection().commit();
preparedStatement.executeBatch();
ConnectDB.getConnection().commit();
ConnectDB.getConnection().close();
}