-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better iceberg support for merge-on-read
- Loading branch information
1 parent
fd85cf1
commit 84b0444
Showing
5 changed files
with
173 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...-plugin/plugin/src/main/scala/org/apache/spark/dataflint/iceberg/ClassLoaderChecker.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.apache.spark.dataflint.iceberg | ||
|
||
import org.apache.iceberg.CatalogUtil | ||
import org.apache.spark.internal.Logging | ||
|
||
object ClassLoaderChecker extends Logging { | ||
def isMetricLoaderInRightClassLoader(): Boolean = { | ||
val metricReporterClass = classOf[DataflintIcebergMetricsReporter] | ||
val classLoaderMetricReporter = metricReporterClass.getClassLoader.toString | ||
val classLoaderIcebergCatalog = classOf[CatalogUtil].getClassLoader.toString | ||
try { | ||
Class.forName(metricReporterClass.getCanonicalName, false, classOf[CatalogUtil].getClassLoader) | ||
} catch { | ||
case _: ClassNotFoundException => | ||
logWarning(s"Cannot load DataflintIcebergMetricsReporter from iceberg classloader, which prevents dataflint iceberg observability support. iceberg classloader: ${classLoaderIcebergCatalog} metric reporter classloader: ${classLoaderMetricReporter}") | ||
return false | ||
case error: Throwable => | ||
logError(s"Unexpected error while trying to load, can use DataflintIcebergMetricsReporter. iceberg classloader: ${classLoaderIcebergCatalog} metric reporter classloader: ${classLoaderMetricReporter}", error) | ||
return false | ||
} | ||
true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters