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:
LFC
2022-09-13 17:10:22 +08:00
committed by GitHub
parent bdd5bdd917
commit ec99eb0cd0
71 changed files with 2324 additions and 362 deletions

View File

@@ -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());

View File

@@ -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)