> On Sept. 26, 2018, 11:20 p.m., Alexander Kolbasov wrote: > > standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java > > Lines 917 (patched) > > <https://reviews.apache.org/r/68827/diff/1/?file=2091788#file2091788line917> > > > > I think a better name would be something like truncateMapByKey. > > > > Can you guarantee that it always receives non-null map? Then you don't > > need to check for null. > > > > Since you don't care about values, can this be a generic map `<String, > > T>`?
Since this is a utility method, I wanted to check for null as it could be called from other classes in future. Making the Map<String, T> > On Sept. 26, 2018, 11:20 p.m., Alexander Kolbasov wrote: > > standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java > > Lines 918 (patched) > > <https://reviews.apache.org/r/68827/diff/1/?file=2091788#file2091788line918> > > > > You already have this check when you call this function. I thought this could be used separately as a utility method, if the user has just one predicate. Should I just keep the other method which accepts a list of predicates and make this one private? > On Sept. 26, 2018, 11:20 p.m., Alexander Kolbasov wrote: > > standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java > > Lines 931 (patched) > > <https://reviews.apache.org/r/68827/diff/1/?file=2091788#file2091788line931> > > > > Naming - may be something like 'truncateMapByKeys'? filter sounds better to me than truncate! I changed method name to filterMapKeys. Let me know if it is fine. > On Sept. 26, 2018, 11:20 p.m., Alexander Kolbasov wrote: > > standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/messaging/json/JSONMessageFactory.java > > Line 297 (original), 310 (patched) > > <https://reviews.apache.org/r/68827/diff/1/?file=2091789#file2091789line310> > > > > The default exclude filter is empty. When someone sets this variable > > they should understand what they are doing. I added a better description for variable in MetastoreConf. Please let know if that is sufficient. > On Sept. 26, 2018, 11:20 p.m., Alexander Kolbasov wrote: > > standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/common/TestMetaStoreUtils.java > > Lines 37 (patched) > > <https://reviews.apache.org/r/68827/diff/1/?file=2091790#file2091790line37> > > > > Can you add a test with an empty exclude pattern? An empty exclude pattern will remove all elements from the map! But when it is done through configuration, the default value returns an empty array, like new String[0]. Hence, the predicates become an empty List. What can I do if needed to add a test for this. - Bharathkrishna ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/68827/#review209055 ----------------------------------------------------------- On Sept. 28, 2018, 9:38 a.m., Bharathkrishna Guruvayoor Murali wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/68827/ > ----------------------------------------------------------- > > (Updated Sept. 28, 2018, 9:38 a.m.) > > > Review request for hive and Alexander Kolbasov. > > > Bugs: HIVE-20545 > https://issues.apache.org/jira/browse/HIVE-20545 > > > Repository: hive-git > > > Description > ------- > > Clients can add large-sized parameters in Table/Partition objects. So we need > to enable adding regex patterns through HiveConf to match parameters to be > filtered from table and partition objects before serialization in HMS > notifications. > > > Diffs > ----- > > > standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java > 30ea7f8129 > > standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java > c681a87a1c > > standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/messaging/json/JSONMessageFactory.java > 2668b05320 > > standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/common/TestMetaStoreUtils.java > PRE-CREATION > > > Diff: https://reviews.apache.org/r/68827/diff/1/ > > > Testing > ------- > > > Thanks, > > Bharathkrishna Guruvayoor Murali > >