I faced to a problem with using limit method from DataFrame API.
I try to get first 999 records from the AVRO source which contains about 3.5K records.
Then after saving operation I get the rows not in the same order as in input data set. Sometimes it gives me proper order but usually not.
Here you can see Spark plan (maybe it can help to figure out the cause of the issue):