Skip to content

Commit

Permalink
spark agent #625 workaround for Symbols#CyclicReference Scala bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cerveada committed Mar 21, 2023
1 parent b68fa1f commit 51c832a
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
package za.co.absa.spline.harvester.converter

import za.co.absa.commons.lang.extensions.TraversableExtension._
import za.co.absa.commons.reflect.ReflectionUtils.ModuleClassSymbolExtractor

import scala.reflect.runtime.universe.ClassSymbol
import scala.util.Try

sealed trait ValueDecomposer {
outer =>
Expand Down Expand Up @@ -52,4 +54,10 @@ object ValueDecomposer extends ValueDecomposer {
case (ModuleClassSymbolExtractor(symbol), _) => Some(symbol.name.toString)
case (x: Any, _) => Some(x.toString)
}

private object ModuleClassSymbolExtractor {
def unapply(o: Any): Option[ClassSymbol] =
// a workaround for Scala bug #12190
Try(za.co.absa.commons.reflect.ReflectionUtils.ModuleClassSymbolExtractor.unapply(o)).toOption.flatten
}
}

0 comments on commit 51c832a

Please sign in to comment.