0

我在scala中有以下代码:

import com.amazon.deequ.analyzers.runners.{AnalysisRunner, AnalyzerContext}
import com.amazon.deequ.analyzers.runners.AnalyzerContext.successMetricsAsDataFrame
import com.amazon.deequ.analyzers.{Compliance, Correlation, Size, Completeness, Mean, ApproxCountDistinct, Maximum, Minimum, Entropy, GroupingAnalyzer}

val analysisResult: AnalyzerContext = { AnalysisRunner
  // data to run the analysis on
  .onData(datasource)
  // define analyzers that compute metrics
  .addAnalyzer(Size())
  .addAnalyzer(Completeness("customerNumber"))
  .addAnalyzer(ApproxCountDistinct("customerNumber"))
  .addAnalyzer(Minimum("creditLimit"))
  .addAnalyzer(Mean("creditLimit"))
  .addAnalyzer(Maximum("creditLimit"))
  .addAnalyzer(Entropy("creditLimit"))
  .run()
}

我想直接打印指标而不明确提及列名。

4

0 回答 0