database-stream-processor icon indicating copy to clipboard operation
database-stream-processor copied to clipboard

Naming of incremental operators is not consistent

Open mihaibudiu opened this issue 3 years ago • 9 comments

For example, we have join and join_incremental, distinct and distinct_incremental, but aggregate and stream_aggregate.

mihaibudiu avatar Oct 19 '22 00:10 mihaibudiu

join and aggregate are both incremental. join_incremental and aggregate_incremental are for testing only and should maybe be removed altogether.

We'll do the same with distinct (i.e., distinct = incremental operator, stream_distinct = non-incremental) once we have an implementation that works in arbitrary nested scopes like join and aggregate do.

ryzhyk avatar Oct 19 '22 00:10 ryzhyk

So what is the non-incremental join?

mihaibudiu avatar Oct 19 '22 00:10 mihaibudiu

So what is the non-incremental join?

stream_join

ryzhyk avatar Oct 19 '22 00:10 ryzhyk

If they are for testing, perhaps they should not be public if it is possible.

mihaibudiu avatar Oct 19 '22 00:10 mihaibudiu

If they are for testing, perhaps they should not be public if it is possible.

Yes, I think they should be hidden.

ryzhyk avatar Oct 19 '22 00:10 ryzhyk

So what is distinct, it is incremental or not?

mihaibudiu avatar Oct 19 '22 00:10 mihaibudiu

Also, while join_incremental works nicely, using join gives this:

   Compiling temp v0.1.0 (/home/mbudiu/git/sql-to-dbsp/temp)
error[E0283]: type annotations needed
   --> src/test.rs:65:174
    |
65  | ...eight>> = stream7135.join(&stream7140, pair7102);
    |                         ^^^^ cannot infer type of the type parameter `TS` declared on the associated function `join`
    |
    = note: cannot satisfy `_: DBTimestamp`
note: required by a bound in `operator::join::<impl dbsp::Stream<Circuit<P>, I1>>::join`
   --> /home/mbudiu/.cargo/git/checkouts/database-stream-processor-4b26262d04ced4e5/7a69d35/src/operator/join.rs:195:13
    |
195 |         TS: DBTimestamp,
    |             ^^^^^^^^^^^ required by this bound in `operator::join::<impl dbsp::Stream<Circuit<P>, I1>>::join`
help: consider specifying the type arguments in the function call
    |
65  |         let stream7145: Stream<_, OrdZSet<Tuple12<i32, F64, bool, String, Option<i32>, Option<F64>, i32, F64, bool, String, Option<i32>, Option<F64>>, Weight>> = stream7135.join::<TS, I2, F, V>(&stream7140, pair7102);
    |                                                                                                                                                                                  ++++++++++++++++

mihaibudiu avatar Oct 19 '22 00:10 mihaibudiu

I think we do need to make sure we're consistent with prefixes like changing .stream_join() to .join_stream() so that it shows up as a suggestion when users start typing in .join

Kixiron avatar Oct 22 '22 17:10 Kixiron

That's a good idea.

ryzhyk avatar Oct 23 '22 17:10 ryzhyk