You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by zhangh43 <gi...@git.apache.org> on 2016/09/22 13:25:52 UTC

[GitHub] incubator-hawq pull request #929: HAWQ-1033. Fix bug in hawq register --forc...

GitHub user zhangh43 opened a pull request:

    https://github.com/apache/incubator-hawq/pull/929

    HAWQ-1033. Fix bug in hawq register --force.

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zhangh43/incubator-hawq hawq10331

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-hawq/pull/929.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #929
    
----
commit 2df377e8b9f20c4b764e99e6b2ba04fd0d9e6c25
Author: hzhang2 <zh...@163.com>
Date:   2016-09-22T13:25:03Z

    HAWQ-1033. Fix bug in hawq register --force.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #929: HAWQ-1033. Fix bug in hawq register --forc...

Posted by xunzhang <gi...@git.apache.org>.
Github user xunzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/929#discussion_r80169925
  
    --- Diff: tools/bin/hawqregister ---
    @@ -469,8 +481,8 @@ class HawqRegister(object):
                 self.filepath = self.files[0][:self.files[0].rfind('/')] if self.files else ''
                 check_file_not_folder()
                 check_database_encoding()
    -            if self.mode != 'force' and self.mode != 'repair':
    -                if not create_table():
    +            if self.mode != 'repair':
    +                if not create_table() and self.mode != 'force':
    --- End diff --
    
    I got.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #929: HAWQ-1033. Fix bug in hawq register --forc...

Posted by zhangh43 <gi...@git.apache.org>.
Github user zhangh43 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/929#discussion_r80163629
  
    --- Diff: tools/bin/hawqregister ---
    @@ -583,7 +595,7 @@ class HawqRegister(object):
                 logger.error("Files to be registered and the table are not in the same hdfs cluster.\nFile(s) to be registered: '%s'\nTable path in HDFS: '%s'." % (filepath, tabledir))
                 sys.exit(1)
     
    -    def _get_files_in_hdfs(self, filepath):
    +    def _get_files_in_hdfs(self, filepath, mode):
    --- End diff --
    
    fixed


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #929: HAWQ-1033. Fix bug in hawq register --forc...

Posted by xunzhang <gi...@git.apache.org>.
Github user xunzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/929#discussion_r80166393
  
    --- Diff: tools/bin/hawqregister ---
    @@ -168,6 +175,10 @@ class GpRegisterAccessor(object):
         def get_table_existed(self, tablename):
             qry = """select count(*) from pg_class where relname = '%s';""" % tablename.split('.')[-1].lower()
             return self.exec_query(qry)[0]['count'] == 1
    +        
    +    def get_table_column_num(self, tablename):
    --- End diff --
    
    I like this modification here!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #929: HAWQ-1033. Fix bug in hawq register --forc...

Posted by zhangh43 <gi...@git.apache.org>.
Github user zhangh43 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/929#discussion_r80168200
  
    --- Diff: tools/bin/hawqregister ---
    @@ -469,8 +481,8 @@ class HawqRegister(object):
                 self.filepath = self.files[0][:self.files[0].rfind('/')] if self.files else ''
                 check_file_not_folder()
                 check_database_encoding()
    -            if self.mode != 'force' and self.mode != 'repair':
    -                if not create_table():
    +            if self.mode != 'repair':
    +                if not create_table() and self.mode != 'force':
    --- End diff --
    
    I just want to create table if not exist in --force mode 
    And if mode is --force we donot change the it
    if not create_table() and self.mode != 'force':
            self.mode = 'usage2_table_exist'
    



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #929: HAWQ-1033. Fix bug in hawq register --forc...

Posted by zhangh43 <gi...@git.apache.org>.
Github user zhangh43 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/929#discussion_r80168324
  
    --- Diff: tools/bin/hawqregister ---
    @@ -469,8 +481,8 @@ class HawqRegister(object):
                 self.filepath = self.files[0][:self.files[0].rfind('/')] if self.files else ''
                 check_file_not_folder()
                 check_database_encoding()
    -            if self.mode != 'force' and self.mode != 'repair':
    -                if not create_table():
    +            if self.mode != 'repair':
    +                if not create_table() and self.mode != 'force':
    --- End diff --
    
    Since table is created by create_table()
    I think there is no need to self.mode='usage2_table_non_exist' instead of 'force'


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #929: HAWQ-1033. Fix bug in hawq register --forc...

Posted by xunzhang <gi...@git.apache.org>.
Github user xunzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/929#discussion_r80169912
  
    --- Diff: tools/bin/hawqregister ---
    @@ -583,7 +595,7 @@ class HawqRegister(object):
                 logger.error("Files to be registered and the table are not in the same hdfs cluster.\nFile(s) to be registered: '%s'\nTable path in HDFS: '%s'." % (filepath, tabledir))
                 sys.exit(1)
     
    -    def _get_files_in_hdfs(self, filepath):
    +    def _get_files_in_hdfs(self, filepath, mode):
    --- End diff --
    
    good \u2764\ufe0f 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #929: HAWQ-1033. Fix bug in hawq register --forc...

Posted by zhangh43 <gi...@git.apache.org>.
Github user zhangh43 closed the pull request at:

    https://github.com/apache/incubator-hawq/pull/929


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #929: HAWQ-1033. Fix bug in hawq register --forc...

Posted by xunzhang <gi...@git.apache.org>.
Github user xunzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/929#discussion_r80166350
  
    --- Diff: tools/bin/hawqregister ---
    @@ -469,8 +481,8 @@ class HawqRegister(object):
                 self.filepath = self.files[0][:self.files[0].rfind('/')] if self.files else ''
                 check_file_not_folder()
                 check_database_encoding()
    -            if self.mode != 'force' and self.mode != 'repair':
    -                if not create_table():
    +            if self.mode != 'repair':
    +                if not create_table() and self.mode != 'force':
    --- End diff --
    
    A little confused here, I think handle the edge case in _init_mode() could be much more clear. In detail, in this case set self.mode='usage2_table_non_exist' instead of 'force'. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #929: HAWQ-1033. Fix bug in hawq register --forc...

Posted by xunzhang <gi...@git.apache.org>.
Github user xunzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/929#discussion_r80041438
  
    --- Diff: tools/bin/hawqregister ---
    @@ -583,7 +595,7 @@ class HawqRegister(object):
                 logger.error("Files to be registered and the table are not in the same hdfs cluster.\nFile(s) to be registered: '%s'\nTable path in HDFS: '%s'." % (filepath, tabledir))
                 sys.exit(1)
     
    -    def _get_files_in_hdfs(self, filepath):
    +    def _get_files_in_hdfs(self, filepath, mode):
    --- End diff --
    
    why don't you use self.mode in this function directly?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---