maheshk114 commented on a change in pull request #664: HIVE-21762: REPL DUMP to
support new format for replication policy input to take included tables list.
URL: https://github.com/apache/hive/pull/664#discussion_r292911182
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java
##########
@@ -131,21 +130,33 @@ private void setTxnConfigs() {
}
}
- private boolean isValidTablesList(Tree tablesListTree) {
- if (tablesListTree.getChildCount() <= 1) {
- // If one or zero child, then it is valid.
- // For single table replication, the valid format is
<db_name>.<table_name>.
- // To include multiple tables (t1 and t2), then valid format is
<db_name>.[t1, t2].
- // So, single child is always valid either it is table_name or
tables_list.
- return true;
- }
- assert(tablesListTree.getChildCount() == 2);
+ private void setReplDumpTablesList(Tree replTablesNode) throws HiveException
{
+ assert(replTablesNode.getChildCount() <= 2);
+
+ // Traverse the children which can be either just include tables list or
both include
+ // and exclude tables lists.
+ for (int listIdx = 0; listIdx < replTablesNode.getChildCount(); listIdx++)
{
Review comment:
replTablesNode.getChildCount can be cached
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]