This is an automated email from the ASF dual-hosted git repository. akshayrai09 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push: new 6005bd2 [TE] Reset null password to empty (#4343) 6005bd2 is described below commit 6005bd2076337e856a606b657e337d52c448f4aa Author: Akshay Rai <akshayra...@gmail.com> AuthorDate: Wed Jun 19 18:01:59 2019 -0700 [TE] Reset null password to empty (#4343) --- thirdeye/thirdeye-pinot/config/h2db.mv.db | Bin 0 -> 2461696 bytes .../datasource/sql/SqlResponseCacheLoader.java | 12 +++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/thirdeye/thirdeye-pinot/config/h2db.mv.db b/thirdeye/thirdeye-pinot/config/h2db.mv.db new file mode 100644 index 0000000..7d567a0 Binary files /dev/null and b/thirdeye/thirdeye-pinot/config/h2db.mv.db differ diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/sql/SqlResponseCacheLoader.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/sql/SqlResponseCacheLoader.java index f7f07d3..5877291 100644 --- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/sql/SqlResponseCacheLoader.java +++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/sql/SqlResponseCacheLoader.java @@ -85,7 +85,7 @@ public class SqlResponseCacheLoader extends CacheLoader<SqlQuery, ThirdEyeResult for (Map<String, Object> objMap: prestoMapList) { Map<String, String> dbNameToURLMap = (Map)objMap.get(DB); String prestoUser = (String)objMap.get(USER); - String prestoPassword = (String)objMap.get(PASSWORD); + String prestoPassword = getPassword(objMap); for (Map.Entry<String, String> entry: dbNameToURLMap.entrySet()) { DataSource dataSource = new DataSource(); @@ -113,7 +113,7 @@ public class SqlResponseCacheLoader extends CacheLoader<SqlQuery, ThirdEyeResult for (Map<String, Object> objMap: mysqlMapList) { Map<String, String> dbNameToURLMap = (Map)objMap.get(DB); String mysqlUser = (String)objMap.get(USER); - String mysqlPassword = (String)objMap.get(PASSWORD); + String mysqlPassword = getPassword(objMap); for (Map.Entry<String, String> entry: dbNameToURLMap.entrySet()) { DataSource dataSource = new DataSource(); @@ -141,7 +141,7 @@ public class SqlResponseCacheLoader extends CacheLoader<SqlQuery, ThirdEyeResult h2DataSource.setInitialSize(INIT_CONNECTIONS); h2DataSource.setMaxActive(MAX_CONNECTIONS); String h2User = (String) objMap.get(USER); - String h2Password = (String) objMap.get(PASSWORD); + String h2Password = getPassword(objMap); h2Url = (String) objMap.get(DB); h2DataSource.setUsername(h2User); h2DataSource.setPassword(h2Password); @@ -204,6 +204,12 @@ public class SqlResponseCacheLoader extends CacheLoader<SqlQuery, ThirdEyeResult } } + private String getPassword(Map<String, Object> objMap) { + String password = (String) objMap.get(PASSWORD); + password = (password == null) ? "" : password; + return password; + } + /** * This method gets the dimension filters for the given dataset from the presto data source, * and returns them as map of dimension name to values --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org