summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHarel Ben-Attia <harelba@gmail.com>2017-04-23 10:26:56 +0300
committerHarel Ben-Attia <harelba@gmail.com>2017-04-23 10:26:56 +0300
commitab509c7bcba8e2aa20cb9b3234124fabd39b7d30 (patch)
tree54ca5c98e7d109810dc0afa491319e6d308cacc0 /bin
parenta81a493bcee35177d5fbdb17e72209723bf91bb1 (diff)
Added proper error messages when having duplicate column names
Diffstat (limited to 'bin')
-rwxr-xr-xbin/q7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/q b/bin/q
index b794ef3..c3b0182 100755
--- a/bin/q
+++ b/bin/q
@@ -525,6 +525,13 @@ class TableColumnInferer(object):
column_name_errors.append(
(v, "Column name must be UTF-8 Compatible"))
continue
+ # We're checking for column duplication for each field in order to be able to still provide it along with other errors
+ if len(filter(lambda x: x == v,value_list)) > 1:
+ entry = (v, "Column name is duplicated")
+ # Don't duplicate the error report itself
+ if entry not in column_name_errors:
+ column_name_errors.append(entry)
+ continue
nul_index = v.find("\x00")
if nul_index >= 0:
column_name_errors.append(