What happened?
Most visualization operator descriptors under common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/ define getOutputSchemas like this:
override def getOutputSchemas(
inputSchemas: Map[PortIdentity, Schema]
): Map[PortIdentity, Schema] = {
val outputSchema = Schema().add("html-content", AttributeType.STRING)
Map(operatorInfo.outputPorts.head.id -> outputSchema)
Map(operatorInfo.outputPorts.head.id -> outputSchema) // ← unreachable duplicate
}
The first Map(...) is computed and discarded; only the second (identical) expression is the actual return value. This is dead code that almost certainly came from a copy-paste, and it appears in 29 files across the visualization package.
How to reproduce?
$ grep -c "Map(operatorInfo.outputPorts.head" \
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/**/*.scala \
| grep ":2"
29 OpDesc files print :2, meaning each one contains two identical Map(...) expressions back-to-back. Files known affected include ImageVisualizerOpDesc, FunnelPlotOpDesc, VolcanoPlotOpDesc, HeatMapOpDesc, BarChartOpDesc, LineChartOpDesc, PieChartOpDesc, BoxViolinPlotOpDesc, WaterfallChartOpDesc, and others. (BulletChartOpDesc does not have the duplicate.)
Version
1.1.0-incubating (Pre-release/Master)
What happened?
Most visualization operator descriptors under
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/definegetOutputSchemaslike this:The first
Map(...)is computed and discarded; only the second (identical) expression is the actual return value. This is dead code that almost certainly came from a copy-paste, and it appears in 29 files across the visualization package.How to reproduce?
29 OpDesc files print
:2, meaning each one contains two identicalMap(...)expressions back-to-back. Files known affected includeImageVisualizerOpDesc,FunnelPlotOpDesc,VolcanoPlotOpDesc,HeatMapOpDesc,BarChartOpDesc,LineChartOpDesc,PieChartOpDesc,BoxViolinPlotOpDesc,WaterfallChartOpDesc, and others. (BulletChartOpDescdoes not have the duplicate.)Version
1.1.0-incubating (Pre-release/Master)