How to integrate a new operator into Texera (from old wiki) #3969
Closed
chenlica
started this conversation in
archived-wiki
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
From the page https://github.com/apache/texera/wiki/How-to-integrate-a-new-operator-into-Texera (may be dangling)
====
Here we only talk about operator that does operation on retrieved data from source operator(e.g. sentiment analytics). This tutorial will not be suitable for source operator and result operator.
What to do on backend
Construct a predicate class
public dummyOperator newOperator() { return new dummyOperator(this); }ImmutableMap.<~>builderto do it.Construct a operator class
api/src/main/java/edu/uci/ics/texera/api/dataflowsetInputOperatormethod, which specifies the previous operator(inputOperator).openmethod, which sets our inputSchema to be the inputOperator's ourputSchema and transforms our inputSchema into appropriate outputSchema. Then methodopensets the cursor toOPENED.getNextTuplemethod, which callsgetNextTupleof the inputOperator to get data from previous step; does operation on this data; adds generated field to the end if necessary; and returns the tuple.closemethod to set the cursor toCLOSED.transformToOutputSchemamethod, which takes inputSchema, modifies it, and returns the outputSchema.Generate JsonSchema
dataflow/src/main/java/edu/uci/ics/texera/api/dataflow/common/JsonSchemaHelper.javamainfunctionmainfunctionIt is a good idea to write a test function for your operator in
dataflow/src/main/java/edu/uci/ics/texera/api/dataflow/common/PredicateBaseTest.javaWhat to do on frontend
core/gui/app/operatorbar/operator-bar.component.html, and set an unique id to itcore/gui/app/services/mock-data.ts, remember to specify your operator's id at the bottom of the filedataflow/src/main/java/edu/uci/ics/texera/dataflow/plangen/OperatorArityConstants.javaCheck the result
Use Running Texera GUI to compile and run backend/frontend
Beta Was this translation helpful? Give feedback.
All reactions