Browse Source

HUE-4364 [metastore] Handle files with carriage return in create table from a file

Hence avoid
PopupException: The headers of the file could not be removed: substring not found
Romain Rigaux 9 years ago
parent
commit
25e6f3c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      desktop/libs/hadoop/src/hadoop/fs/webhdfs.py

+ 4 - 0
desktop/libs/hadoop/src/hadoop/fs/webhdfs.py

@@ -579,6 +579,10 @@ class WebHdfs(Hdfs):
 
     while True:
       data = self.read(src, offset, UPLOAD_CHUNK_SIZE.get())
+
+      if skip_header:
+        data = '\n'.join(data.splitlines())
+
       cnt = len(data)
 
       if offset == 0: