diff --git a/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/ConnectDB.java b/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/ConnectDB.java index 05d79d854d..70343f525d 100644 --- a/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/ConnectDB.java +++ b/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/ConnectDB.java @@ -44,7 +44,7 @@ public abstract class ConnectDB { dbURL = "jdbc:hive2://iis-cdh5-test-m3.ocean.icm.edu.pl:10000/;UseNativeQuery=1"; usageStatsDBSchema = "usagestats"; - statsDBSchema = "stats_wf_db_galexiou_oozie_beta"; + statsDBSchema = "openaire_prod_stats_shadow_20200821"; Class.forName("org.apache.hive.jdbc.HiveDriver"); } diff --git a/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/PiwikDownloadLogs.java b/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/PiwikDownloadLogs.java index 4b2875a2f9..ff6718706b 100644 --- a/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/PiwikDownloadLogs.java +++ b/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/PiwikDownloadLogs.java @@ -85,19 +85,12 @@ public class PiwikDownloadLogs { Statement statement = ConnectDB.getConnection().createStatement(); -// ResultSet rs = statement -// .executeQuery( -// "SELECT distinct piwik_id from " + ConnectDB.getStatsDBSchema() -// + ".datasource where piwik_id is not null order by piwik_id"); -// while (rs.next()) { -// int siteId = rs.getInt(1); - - for (int manualSiteId : new int[] { - 13, 23 -// , 109 -> This seems to be empty - }) { - int siteId = manualSiteId; // Until the stats database (datasource table) provides a correct id, we set it - // to 13 + ResultSet rs = statement + .executeQuery( + "SELECT distinct piwik_id from " + ConnectDB.getStatsDBSchema() + + ".datasource where piwik_id is not null and piwik_id <> 0 order by piwik_id"); + while (rs.next()) { + int siteId = rs.getInt(1); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-MM"); Calendar start = Calendar.getInstance(); diff --git a/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/PiwikStatsDB.java b/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/PiwikStatsDB.java index 1d91413066..e58def260f 100644 --- a/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/PiwikStatsDB.java +++ b/dhp-workflows/dhp-usage-stats-update/src/main/java/eu/dnetlib/oa/graph/usagestats/export/PiwikStatsDB.java @@ -40,7 +40,9 @@ public class PiwikStatsDB { this.logRepoPath = logRepoPath; this.logPortalPath = logPortalPath; this.createTables(); - this.createTmpTables(); + // The piwiklog table is not needed since it is built + // on top of JSON files +// this.createTmpTables(); } public void foo() {