mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-28 00:42:56 +00:00
refactor: pub HttpOutputWriter for external use (#7287)
Signed-off-by: luofucong <luofc@foxmail.com>
This commit is contained in:
@@ -43,17 +43,14 @@ pub(crate) mod null_result;
|
||||
pub(crate) mod prometheus_resp;
|
||||
pub(crate) mod table_result;
|
||||
|
||||
pub(super) struct HttpOutputWriter {
|
||||
pub struct HttpOutputWriter {
|
||||
columns: usize,
|
||||
value_transformer: Option<Box<dyn Fn(Value) -> Value>>,
|
||||
current: Option<Vec<serde_json::Value>>,
|
||||
}
|
||||
|
||||
impl HttpOutputWriter {
|
||||
pub(super) fn new(
|
||||
columns: usize,
|
||||
value_transformer: Option<Box<dyn Fn(Value) -> Value>>,
|
||||
) -> Self {
|
||||
pub fn new(columns: usize, value_transformer: Option<Box<dyn Fn(Value) -> Value>>) -> Self {
|
||||
Self {
|
||||
columns,
|
||||
value_transformer,
|
||||
@@ -101,7 +98,7 @@ impl HttpOutputWriter {
|
||||
self.current.take().unwrap_or_default()
|
||||
}
|
||||
|
||||
pub(super) fn write(
|
||||
pub fn write(
|
||||
&mut self,
|
||||
record_batch: RecordBatch,
|
||||
rows: &mut Vec<Vec<serde_json::Value>>,
|
||||
|
||||
Reference in New Issue
Block a user