----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/63886/ -----------------------------------------------------------
Review request for sentry, kalyan kumar kalvagadda, Na Li, Sergio Pena, and Vadim Spector. Repository: sentry Description ------- Current isTableEmpty implementation is below private boolean isTableEmptyCore(PersistenceManager pm, Class clazz) { Query query = pm.newQuery(clazz); query.addExtension(LOAD_RESULTS_AT_COMMIT, "false"); // setRange is implemented efficiently for MySQL, Postgresql (using the LIMIT SQL keyword) // and Oracle (using the ROWNUM keyword), with the query only finding the objects required // by the user directly in the datastore. For other RDBMS the query will retrieve all // objects up to the "to" record, and will not pass any unnecessary objects that are before // the "from" record. query.setRange(0, 1); return ((List<MAuthzPathsMapping>) query.execute()).isEmpty(); } We seem to be casting query.execute to a List<MAuthzPathsMapping> when there is no need for it Diffs ----- sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java 7217dea7a Diff: https://reviews.apache.org/r/63886/diff/1/ Testing ------- mvn -f sentry-tests/sentry-tests-hive/pom.xml test -Dtest=TestPrivilegesAtTableScopePart1 Thanks, Arjun Mishra