missing data when reading avro file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Incomplete
|
Undecided
|
Unassigned | ||
Sahara |
New
|
Undecided
|
Unassigned |
Bug Description
library used: org.apache.
We are loading avro files from Oracle Storage Service server (i.e., Swift server) into Spark DataFrame object through the Spark Data Source API. For example:
return hiveCtx.
The number of records is less than the actual record count in the avro file when reading the avro file from Storage Service server using OpenStack Swift API.
If we run a SQL on top of the returned data frome like "select count(*) as C1 from <temp table>" we can see the record count is smaller when reading the same avro file from local file system.
For a large avro file (awclassic.avro, 105M) the count is always wrong (42451 records vs. 60855). From the log file we can see the reading os the file is splitted into 4:
2016-09-01 14:18:27 INFO HadoopRDD:59 - Input split: swift:/
2016-09-01 14:18:27 INFO HadoopRDD:59 - Input split: swift:/
2016-09-01 14:18:27 INFO HadoopRDD:59 - Input split: swift:/
2016-09-01 14:18:27 INFO HadoopRDD:59 - Input split: swift:/
For a smaller avro file (wine.avro, 19M) the count sometimes is correct (57076 records) and sometimes wrong (26999 records). Run the same spark SQL 10 times back-to-back produces the following record count results:
run 1: 26999
run 2: 26999
run 3: 57076
run 4: 57056
run 5: 57076
run 6: 26999
run 7: 57076
run 8: 57076
run 9: 57076
run 10: 57076
For this wine.avro test case there are two splits:
2016-08-31 17:42:32 INFO HadoopRDD:59 - Input split: swift:/
2016-08-31 17:42:32 INFO HadoopRDD:59 - Input split: swift:/
I have attach a zip file containing the two avro files in question and the debugged log file section of reading wine.avro file - one with successful reading(C4.ok) and one with missing record reading(C5.miss).
Changed in swift: | |
status: | New → Incomplete |
Correction:
old: we can see the record count is smaller when reading the same avro file from local file system.
new: we can see the record count is ALWAYS CORRECT when reading the same avro file from local file system.