Skip to content

Commit

Permalink
fix StrIntToBinary bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xitongsys committed Dec 20, 2017
1 parent b646f9c commit a7eec08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ParquetType/ParquetType.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func StrIntToBinary(num string, order string, length int32, signed bool) string
}

numBytes := []string{}
for i := 8; i < len(binStr); i += 8 {
for i := 0; i < len(binStr); i += 8 {
numBytes = append(numBytes, binStr[i:i+8])
}
resBytes := []byte{}
Expand Down
2 changes: 1 addition & 1 deletion example/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func main() {
TimeMicros: int64(i),
TimestampMillis: int64(i),
TimestampMicros: int64(i),
Interval: "012345678912",
Interval: ParquetType.StrIntToBinary("12345", "LittleEndian", 12, true),
Decimal: ParquetType.StrIntToBinary("12345", "BigEndian", 0, true),
}
pw.Write(tp)
Expand Down

0 comments on commit a7eec08

Please sign in to comment.