瀏覽代碼

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 年之前
父節點
當前提交
25e6f3c584
共有 1 個文件被更改,包括 4 次插入0 次删除
  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: