I'm using deequ to write analyzer. My editor is showing me this warning and I'm not sure how to fix this warning.
On line this:
Analyzer analyzer = new PatternMatch("email", Patterns.EMAIL(), option);
I get this warning in IntelliJ.
Raw use of parameterized class 'Analyzer'
I get suggestion to change Analyzer
to Analyzer<NumMatchesAndCount, DoubleMetric>
. When I do that, this warning is solved, however, on doing that, I get an error in following line:
AnalysisRunBuilder analysisBuilder = AnalysisRunner.onData(table);
analysisBuilder.addAnalyzer(analyzer);
The error I get:
Required type: Analyzer<?,Metric<?>>
Provided: Analyzer<NumMatchesAndCount, DoubleMetric>
Also DoubleMetric
implements Metric interface (public class DoubleMetric implements Metric, Product, Serializable
), so we should not get the error described above in my opinion. Am I right?
Signature of addAnalyzer
function in above line is:
public AnalysisRunBuilder addAnalyzer(Analyzer analyzer) {
this.analyzers_$eq((Seq)this.analyzers().$colon$plus(analyzer, .MODULE$.canBuildFrom()));
return this;
}
My doubt is, when the signature of the function is not expecting parameterized class Analyzer
, why am I getting warning that expected type is Analyzer<?,Metric<?>>
?
My goal is to find out how exactly to use addAnalyzer
function described above? In this function, I want to pass an instance of PatternMatch
class. This class is implemented as follows: PatternMatch
extends abstract class StandardScanShareableAnalyzer
which implements interface ScanShareableAnalyzer
which in turn extends Analyzer
class.