espertechinc / esper

Esper Complex Event Processing, Streaming SQL and Event Series Analysis
GNU General Public License v2.0
839 stars 259 forks source link

Zeppelin Notebook has compile exception when multiple modules and create-schema (ordering issue?) #183

Open AhmedAwad opened 4 years ago

AhmedAwad commented 4 years ago

After I start a notebook and create some schemas and start adding new queries, the notebook starts generating an exception Failed compiler startup: com.espertech.esper.common.client.EPException: Failed to find event type 'LabeledEvent' among public types, modules-in-path or the current module itself. The labeledEvent is a schema that I have created and already tested a scenario inserting events and queries on it.

It seems that the runtime rerunning the cell of the create schema does not help.

Would there be a way to reset everything and refresh the interpreter?

I am not sure how to attach the notebook.

bernhardttom commented 4 years ago

Can you cut&paste the notebook cells into the issue please. Does creating a new note fix it?

bernhardttom commented 4 years ago

There is currently no way to restart the interpreter.

AhmedAwad commented 4 years ago

Creating a new notebook and copying the code to it temporarily fixes the issue but it reappears.

Here is the code

create table Cases (caseID long primary key);

create schema UnlabeledEvent( activity string, timestamp long); @Name('Unlabeled') select * from UnlabeledEvent;

%esperepl create schema LabeledEvent(caseID long, activity string, timestamp long, probability double); @Name('Labeled') select * from LabeledEvent; executing this command I start getting the error

Failed compiler startup: com.espertech.esper.common.client.EPException: Failed to find event type 'LabeledEvent' among public types, modules-in-path or the current module itself

I keep getting the same error for any further command being executed

The rest of commands

create schema SyncIJ( caseID long, timestamp long, probability double);

insert into Cases select (select coalesce(max(C.caseID)+1, 1) from Cases as C) as caseID from UnlabeledEvent as UE where UE.activity = 'A';

insert into LabeledEvent (caseID, activity, timestamp, probability) select (select max(caseID) from Cases) as caseID, UE.activity, UE.timestamp, 1.0 from UnlabeledEvent as UE where UE.activity = 'A';

insert into LabeledEvent (caseID, activity, timestamp, probability) select pred.caseID, 'B', succ.timestamp, 0.25 from pattern [ every( pred=LabeledEvent(activity='A')) -> succ=UnlabeledEvent(activity='B') ] where succ.timestamp - pred.timestamp >= 1; ...

bernhardttom commented 4 years ago

Try putting the EPL into the same box. Zeppelin may mix up ordering?

AhmedAwad commented 4 years ago

It worked when I put all the epl statements in one cell and the epl scenario in the next one.

Thanks :)

But, is this something related to Zeppelin or Esper interpreter?

bernhardttom commented 4 years ago

I guess possibly Zeppelin mixes up the order of cells, so that the create-schema goes last, even though it shows up on the web page as first.