case class CoMomentDFMetricCalculator(metricId: String, columns: Seq[String]) extends DFMetricCalculator with Product with Serializable
Calculates co-moment between values of two columns
- metricId
Id of the metric.
- columns
Sequence of columns which are used for metric calculation
- Note
Differs from RDD calculator in terms of processing values that are not numbers: RDD calculator will yield NaN if at least one value cannot be cast to Double. DF calculator just skips rows where some of the values cannot be cast to Duble.
- Alphabetic
- By Inheritance
- CoMomentDFMetricCalculator
- Serializable
- Serializable
- Product
- Equals
- DFMetricCalculator
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
val
columns: Seq[String]
- Definition Classes
- CoMomentDFMetricCalculator → DFMetricCalculator
-
val
emptyValue: Column
Value which is returned when metric result is null.
Value which is returned when metric result is null.
- Attributes
- protected
- Definition Classes
- CoMomentDFMetricCalculator → DFMetricCalculator
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
errorConditionExpr(implicit colTypes: Map[String, DataType]): Column
If casting value to DoubleType yields null for any column, then it is a signal that value is not a number.
If casting value to DoubleType yields null for any column, then it is a signal that value is not a number. Thus, covariance computation can't be incremented for this row. This is a metric increment failure.
- colTypes
Map of column names to their datatype.
- returns
Spark row-level expression yielding boolean result.
- Attributes
- protected
- Definition Classes
- CoMomentDFMetricCalculator → DFMetricCalculator
-
def
errorExpr(rowData: Column)(implicit colTypes: Map[String, DataType]): Column
Error collection expression: collects row data in case of metric error.
Error collection expression: collects row data in case of metric error.
- rowData
Array of row data from columns related to this metric calculator (source keyFields + metric columns + window start time column for streaming applications)
- colTypes
Map of column names to their datatype.
- returns
Spark expression that will yield row data in case of metric error.
- Attributes
- protected
- Definition Classes
- DFMetricCalculator
-
def
errorMessage: String
Error message that will be returned when column value cannot be cast to Double type.
Error message that will be returned when column value cannot be cast to Double type.
- returns
Metric increment failure message.
- Definition Classes
- CoMomentDFMetricCalculator → DFMetricCalculator
-
def
errors(implicit errorDumpSize: Int, keyFields: Seq[String], colTypes: Map[String, DataType]): Column
Final metric errors aggregation expression.
Final metric errors aggregation expression. Collects all metric errors into an array column. The size of array is limited by maximum allowed error dump size parameter.
- errorDumpSize
Maximum allowed number of errors to be collected per single metric.
- keyFields
Sequence of source/stream key fields.
- colTypes
Map of column names to their datatype.
- returns
Spark expression that will yield array of metric errors.
- Definition Classes
- DFMetricCalculator
-
val
errorsCol: String
Name of the column that will store metric errors
Name of the column that will store metric errors
- Definition Classes
- DFMetricCalculator
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
metricId: String
Unlike RDD calculators, DF calculators are not groped by its type.
Unlike RDD calculators, DF calculators are not groped by its type. For each metric defined in DQ job, there will be created its own instance of DF calculator. Thus, DF metric calculators can be linked to metric definitions by metricId.
- Definition Classes
- CoMomentDFMetricCalculator → DFMetricCalculator
-
val
metricName: MetricName
- Definition Classes
- CoMomentDFMetricCalculator → DFMetricCalculator
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
result(implicit colTypes: Map[String, DataType]): Column
Final metric aggregation expression that MUST yield double value.
Final metric aggregation expression that MUST yield double value.
- colTypes
Map of column names to their datatype.
- returns
Spark expression that will yield double metric calculator result
- Definition Classes
- DFMetricCalculator
-
val
resultAggregateFunction: (Column) ⇒ Column
Aggregation function for covariance metric is covar_pop Spark function.
Aggregation function for covariance metric is covar_pop Spark function. This function skips rows where value in other of the columns is null i.e. cannot be cast to double type. In order to convert covariance value to co-moment value we need to multiply the former one with number of rows where both of the column values can be cast to DoubleType.
- Attributes
- protected
- Definition Classes
- CoMomentDFMetricCalculator → DFMetricCalculator
-
val
resultCol: String
Name of the column that will store metric result
Name of the column that will store metric result
- Definition Classes
- DFMetricCalculator
-
def
resultExpr(implicit colTypes: Map[String, DataType]): Column
Retrieves double value from left column.
Retrieves double value from left column.
- colTypes
Map of column names to their datatype.
- returns
Spark row-level expression yielding numeric result.
- Attributes
- protected
- Definition Classes
- CoMomentDFMetricCalculator → DFMetricCalculator
-
def
rowDataExpr(keyFields: Seq[String]): Column
Row data collection expression: collects values of selected columns to array for row where metric error occurred.
Row data collection expression: collects values of selected columns to array for row where metric error occurred.
- keyFields
Sequence of source/stream key fields.
- returns
Spark expression that will yield array of row data for column related to this metric calculator.
- Attributes
- protected
- Definition Classes
- DFMetricCalculator
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()