Github user xunzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/910#discussion_r79388042
  
    --- Diff: tools/bin/hawqregister ---
    @@ -585,6 +596,20 @@ class HawqRegister(object):
             query += "end transaction;"
             return self.utility_accessor.update_catalog(query)
     
    +    def _mapping_tablename_from_yml(self, partitions):
    --- End diff --
    
    It is a little like c-style python, I recommend to rewrite it as below:
    
    ```
    def _mapping_tablename_from_yml(self, partitions):
        ''' Mapping table name from yml file, return a list of 
(table_name,(file_path, file_size)) '''
        for pos, constraint in enumerate(self.partitions_constraint):
            if partitions.has_key(constraint):
                mappings = ([(partitions[constraint], 
(self.partitions_filepaths[pos][i], self.partitions_filesizes[pos][i]))
                            for i in 
xrange(len(self.partitions_filepaths[pos]))])
        return mappings
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to