Skip to content

Commit

Permalink
Improve code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghislain Fourny committed Jul 11, 2024
1 parent a4499f0 commit 4dbe3b8
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
import com.esotericsoftware.kryo.io.Output;

import scala.collection.immutable.ArraySeq;
import scala.collection.Iterator;
import sparksoniq.spark.SparkSessionManager;

public class FlworDataFrameUtils {
Expand Down Expand Up @@ -812,14 +813,15 @@ public static void deserializeWrappedParameters(
Kryo kryo,
Input input
) {
Object[] serializedParams = (Object[]) wrappedParameters.unsafeArray();
for (Object serializedParam : serializedParams) {
if (serializedParam == null) {
Iterator<byte[]> iterator = wrappedParameters.iterator();
while (iterator.hasNext()) {
byte[] bytes = iterator.next();
if (bytes == null) {
deserializedParams.add(Collections.emptyList());
continue;
}
@SuppressWarnings("unchecked")
List<Item> deserializedParam = (List<Item>) deserializeByteArray((byte[]) serializedParam, kryo, input);
List<Item> deserializedParam = (List<Item>) deserializeByteArray(bytes, kryo, input);
deserializedParams.add(deserializedParam);
}
}
Expand Down

0 comments on commit 4dbe3b8

Please sign in to comment.