Repository: incubator-hawq Updated Branches: refs/heads/master 98d48e78d -> bc873239e
HAWQ-1061. Check folder and eof not conflict under usage1. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/bc873239 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/bc873239 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/bc873239 Branch: refs/heads/master Commit: bc873239e4e7b9cf00e63b2e2dc9982ed7273f66 Parents: 98d48e7 Author: xunzhang <[email protected]> Authored: Tue Sep 27 16:34:54 2016 +0800 Committer: Lili Ma <[email protected]> Committed: Wed Sep 28 10:22:58 2016 +0800 ---------------------------------------------------------------------- tools/bin/hawqregister | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/bc873239/tools/bin/hawqregister ---------------------------------------------------------------------- diff --git a/tools/bin/hawqregister b/tools/bin/hawqregister index cc65491..4b7655c 100755 --- a/tools/bin/hawqregister +++ b/tools/bin/hawqregister @@ -487,6 +487,13 @@ class HawqRegister(object): logger.info('%s is not a file in hdfs, please check the yaml configuration file.' % fn) sys.exit(1) + def is_folder(filepath): + hdfscmd = 'hdfs dfs -test -d %s' % filepath + if local_ssh(hdfscmd, logger): + return False + else: + return True + def check_sizes_valid(): for sz in self.sizes: if type(sz) != type(1): @@ -532,6 +539,9 @@ class HawqRegister(object): check_policy_consistency() check_no_regex_filepath(self.files) else: + if is_folder(self.filepath) and self.filesize: + logger.error('-e option is only supported with single file case.') + sys.exit(1) self.file_format = 'Parquet' check_hash_type() # Usage1 only support randomly distributed table if not self.filepath:
