> On Aug. 4, 2015, 5:50 p.m., Sravya Tirukkovalur wrote: > > sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java, > > line 337 > > <https://reviews.apache.org/r/37086/diff/1/?file=1028784#file1028784line337> > > > > What happens if either of the paths (old/new) are empty? Is that > > possible at all ? In either case: we should either handle it or atleast > > throw an error, as it might cause a nullpointer as well. > > Sravya Tirukkovalur wrote: > I meant atleast log an error.
We can definitely hit a sitauation where we have a null oldPath or newPath. This is the exact sitation that causes the failure. Altering an existing VIEW results in both a null oldPath and null newPath. i.e Alter view v1 as select * from table1, Create or Replace view v1 as select * from table1. Thanks for catching thise however as it is definitely not the ideal place to perfrom a Null check. The NPE does not actually cause an issue until we get to org.apache.commons.httpclient.util.EncodingUtil.getBytes. Everyone else handles the null gracefully. MetastorePlugin.renameAuthzObject => PathsUpdate.parsePath => URI uri = new URI(URIUtil.encodePath(path)); Instead I will move the Null check to PathsUpdate.parsePath so we may avoid this in all situation which call parse path rather than this specific one. Thanks! - Ryan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/37086/#review94090 ----------------------------------------------------------- On Aug. 4, 2015, 5:13 p.m., Ryan Pridgeon wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/37086/ > ----------------------------------------------------------- > > (Updated Aug. 4, 2015, 5:13 p.m.) > > > Review request for sentry. > > > Repository: sentry > > > Description > ------- > > SENTRY-780: HDFS Plugin should not execute path callbacks for views > > > Diffs > ----- > > > sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java > 4924669 > > sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegration.java > d75c578 > > Diff: https://reviews.apache.org/r/37086/diff/ > > > Testing > ------- > > Create, Drop, Create or Replace as Views with Sentry-Sync enabled. > > > Thanks, > > Ryan Pridgeon > >
