spark-xml icon indicating copy to clipboard operation
spark-xml copied to clipboard

Fix Scala ArrayBuffer cast to Spark ArrayData for Scala 2.13

Open hipp0gryph opened this issue 1 year ago • 3 comments

Closes #688

Fix problem with cast scala.collection.mutable.ArrayBuffer to org.apache.spark.sql.catalyst.util.ArrayData

hipp0gryph avatar Aug 11 '24 19:08 hipp0gryph

Hm, I don't think it's quite that simple unfortunately - it causes some test to fail. I'm not totally sure why. It seems like building an Array this way doesn't quite work, ends up with 1 element not 3 for some reason, when 3 should be the result of the array xs_any column.

It may be that you have to try returning an array later somewhere, I'm not sure.

We'd also have to make a change in spark to match this, as the code really lives there now, but that's for later.

srowen avatar Aug 11 '24 20:08 srowen

Hm, I don't think it's quite that simple unfortunately - it causes some test to fail. I'm not totally sure why. It seems like building an Array this way doesn't quite work, ends up with 1 element not 3 for some reason, when 3 should be the result of the array xs_any column.

It may be that you have to try returning an array later somewhere, I'm not sure.

We'd also have to make a change in spark to match this, as the code really lives there now, but that's for later.

Okay) I really bad in Scala. After that errors I know my target on future :) I think problem in immutability Array type. I think that problem need harder solution, but we can try start tests and dream about success)

hipp0gryph avatar Aug 11 '24 23:08 hipp0gryph

@srowen Hello! Can you run tests, please? Thank you in advance!

hipp0gryph avatar Aug 14 '24 19:08 hipp0gryph