You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL/DR: How to trigger loading initial data from the source streams using the Scala API?
Using DBToaster 2.2 (rev. 3387), I was experimenting with the Scala API. I went through the following steps:
Compilation and run from the command line
Following the docs in Sec.1. Compiling and running a query, I successfully compiled and run the examples/queries/simple/rst.sql query from the command line, which gave the expected result:
Then I went on to the example code in Sec.2. Scala API Guide, we created a project to use the example query from Scala, which gave exactly the same output as given in the docs:
Insert a tuple into R.
Insert a tuple into S.
Insert a tuple into T.
Result after this step: 20
Insert another tuple into T.
Final Result: 45
The Scala project has access at in-the-query specified path to the initial stream data for the rst query, but the results show it doesn't load that: initial data gave ATIMESD 306, but the Scala call resulted in 20 and 45 after inserting a few more tuples, but without deleting any.
Is there a way to trigger loading the initial stream data specified in the CREATE STREAM statement through the Scala API?
Inspecting the vanilla Scala generated code
I tried to inspect the generated vanilla Scala code for the query:
I found that the def main of the main class invokes def execute, which feeds the streaming relations from the input files, but I found no way to invoke this by sending some events.
def main and def execute from the generated vscala code:
defexecute(args: Array[String], f: List[Any] =>Unit) = bench(args, (dataset: String, parallelMode: Int, timeout: Long, batchSize: Int) => run[Rst](Seq(
(new java.io.FileInputStream("examples/data/simple/r.dat"),newAdaptor.CSV("R","long,long","\\Q,\\E", if (dataset.endsWith("_del")) "ins + del"else"insert"),Split()),
(new java.io.FileInputStream("examples/data/simple/s.dat"),newAdaptor.CSV("S","long,long","\\Q,\\E", if (dataset.endsWith("_del")) "ins + del"else"insert"),Split()),
(new java.io.FileInputStream("examples/data/simple/t.dat"),newAdaptor.CSV("T","long,long","\\Q,\\E", if (dataset.endsWith("_del")) "ins + del"else"insert"),Split())
), parallelMode, timeout, batchSize), f)
defmain(args: Array[String]) {
execute(args, (res: List[Any]) => {
println("ATIMESD:\n"+M3Map.toStr(res(0))+"\n")
})
}
I was wondering if StreamInit event were intended to initialize initialize the stream from the predefined stream sources, or there are some events missing:
TL/DR: How to trigger loading initial data from the source streams using the Scala API?
Using DBToaster 2.2 (rev. 3387), I was experimenting with the Scala API. I went through the following steps:
Compilation and run from the command line
Following the docs in Sec.1. Compiling and running a query, I successfully compiled and run the
examples/queries/simple/rst.sql
query from the command line, which gave the expected result:Using the Scala API
Then I went on to the example code in Sec.2. Scala API Guide, we created a project to use the example query from Scala, which gave exactly the same output as given in the docs:
The Scala project has access at in-the-query specified path to the initial stream data for the rst query, but the results show it doesn't load that: initial data gave ATIMESD 306, but the Scala call resulted in 20 and 45 after inserting a few more tuples, but without deleting any.
Is there a way to trigger loading the initial stream data specified in the
CREATE STREAM
statement through the Scala API?Inspecting the vanilla Scala generated code
I tried to inspect the generated vanilla Scala code for the query:
I found that the
def main
of the main class invokesdef execute
, which feeds the streaming relations from the input files, but I found no way to invoke this by sending some events.def main
anddef execute
from the generated vscala code:I was wondering if
StreamInit
event were intended to initialize initialize the stream from the predefined stream sources, or there are some events missing:The text was updated successfully, but these errors were encountered: