Cause:
the sink manager type for visualizer operators is still "edu.uci.ics.texera.workflow.operators.sink.storage.MemoryStorage" even if the mode is set to mongodb. This results in the inability to access sinkMgr.getAllFields() as expected for MongoDB storage.
Fix:
Ensure that the "fields" array obtained from "val fields = sinkMgr.getAllFields()" is not empty. If fields is not empty, this indicates that the MongoDB storage is correctly accessed and contains valid data. Here is the implemented fix:
Check if fields is not empty:
Only proceed with updating tableFields if fields is not empty and has the required length of at least 3.
Update tableFields:
If fields meets the criteria, update tableFields with the relevant field mappings.
Compute statistics:
Ensure tableFields contains the necessary fields before computing statistics for categorical, date, and numeric fields.
Issue number: #2729
Cause: the sink manager type for visualizer operators is still "edu.uci.ics.texera.workflow.operators.sink.storage.MemoryStorage" even if the mode is set to mongodb. This results in the inability to access sinkMgr.getAllFields() as expected for MongoDB storage.
Fix: Ensure that the "fields" array obtained from "val fields = sinkMgr.getAllFields()" is not empty. If fields is not empty, this indicates that the MongoDB storage is correctly accessed and contains valid data. Here is the implemented fix:
Check if fields is not empty: Only proceed with updating tableFields if fields is not empty and has the required length of at least 3.
Update tableFields: If fields meets the criteria, update tableFields with the relevant field mappings.
Compute statistics: Ensure tableFields contains the necessary fields before computing statistics for categorical, date, and numeric fields.