Skip to content

Commit

Permalink
byzer-org#1832 fix load csv option encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmondGuo committed Aug 31, 2022
1 parent 53a2921 commit 4371473
Showing 1 changed file with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,33 +282,33 @@ object HDFSOperatorV2 {
br = new BufferedReader(new InputStreamReader(fs.open(src), charset))
line = br.readLine()

var count = 1
while (line != null) {

if (header && count == 1) {
dos.write((line + "\n").getBytes(charset))
line = br.readLine()
}

if (count >= skipFirstNLines) {
dos.write((line + "\n").getBytes(charset))
}
count += 1
var count = 1
while (line != null) {

if (header && count == 1) {
dos.write((line + "\n").getBytes(charset))
line = br.readLine()
}
} finally {
if (br != null) br.close()
if (null != dos) {
try {
dos.close()
} catch {
case ex: Exception =>
println("close exception")
}

if (count >= skipFirstNLines) {
dos.write((line + "\n").getBytes(charset))
}
count += 1
line = br.readLine()
}
} finally {
if (br != null) br.close()
if (null != dos) {
try {
dos.close()
} catch {
case ex: Exception =>
println("close exception")
}
dos.close()
}
}
outPath
}
outPath
}
}

0 comments on commit 4371473

Please sign in to comment.