mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-17 02:32:56 +00:00
feat: frontend instance (#238)
* feat: frontend instance * no need to carry column length in `Column` proto * add more tests * rebase develop * create a new variant with already provisioned RecordBatches in Output * resolve code review comments * new frontend instance does not connect datanode grpc * add more tests * add more tests * rebase develop Co-authored-by: luofucong <luofucong@greptime.com>
This commit is contained in:
@@ -88,9 +88,7 @@ impl Script for PyScript {
|
||||
let res = self.query_engine.execute(&plan).await?;
|
||||
let copr = self.copr.clone();
|
||||
match res {
|
||||
query::Output::RecordBatch(stream) => {
|
||||
Ok(Output::RecordBatch(Box::pin(CoprStream { copr, stream })))
|
||||
}
|
||||
Output::Stream(stream) => Ok(Output::Stream(Box::pin(CoprStream { copr, stream }))),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
} else {
|
||||
@@ -178,7 +176,7 @@ def test(a, b, c):
|
||||
.unwrap();
|
||||
let output = script.execute(EvalContext::default()).await.unwrap();
|
||||
match output {
|
||||
Output::RecordBatch(stream) => {
|
||||
Output::Stream(stream) => {
|
||||
let numbers = util::collect(stream).await.unwrap();
|
||||
|
||||
assert_eq!(1, numbers.len());
|
||||
@@ -209,7 +207,7 @@ def test(a):
|
||||
.unwrap();
|
||||
let output = script.execute(EvalContext::default()).await.unwrap();
|
||||
match output {
|
||||
Output::RecordBatch(stream) => {
|
||||
Output::Stream(stream) => {
|
||||
let numbers = util::collect(stream).await.unwrap();
|
||||
|
||||
assert_eq!(1, numbers.len());
|
||||
|
||||
@@ -143,7 +143,7 @@ impl ScriptsTable {
|
||||
.await
|
||||
.context(FindScriptSnafu { name })?
|
||||
{
|
||||
Output::RecordBatch(stream) => stream,
|
||||
Output::Stream(stream) => stream,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
let records = record_util::collect(stream)
|
||||
|
||||
Reference in New Issue
Block a user