Преглед на файлове

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: