Skip to content

Commit 47b8e2f

Browse files
committed
pass SchemaRef to load methods.
1 parent 232f0f8 commit 47b8e2f

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

packages/cubejs-backend-native/src/transport.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ impl TransportService for NodeBridgeTransport {
334334
sql_query: Option<SqlQuery>,
335335
ctx: AuthContextRef,
336336
meta: LoadRequestMeta,
337+
_schema: SchemaRef,
337338
// ) -> Result<Vec<RecordBatch>, CubeError> {
338339
) -> Result<TransportLoadResponse, CubeError> {
339340
trace!("[transport] Request ->");

rust/cubesql/cubesql/src/compile/engine/df/scan.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ impl ExecutionPlan for CubeScanExecutionPlan {
662662
self.auth_context.clone(),
663663
self.transport.clone(),
664664
meta.clone(),
665+
self.schema.clone(),
665666
self.options.clone(),
666667
self.wrapped_sql.clone(),
667668
)
@@ -840,6 +841,7 @@ async fn load_data(
840841
auth_context: AuthContextRef,
841842
transport: Arc<dyn TransportService>,
842843
meta: LoadRequestMeta,
844+
schema: SchemaRef,
843845
options: CubeScanOptions,
844846
sql_query: Option<SqlQuery>,
845847
) -> ArrowResult<V1LoadResult> {
@@ -871,7 +873,7 @@ async fn load_data(
871873
)
872874
} else {
873875
let result = transport
874-
.load(span_id, request, sql_query, auth_context, meta)
876+
.load(span_id, request, sql_query, auth_context, meta, schema)
875877
.await;
876878
let mut response = result.map_err(|err| ArrowError::ComputeError(err.to_string()))?;
877879
if let Some(data) = response.results.pop() {
@@ -899,6 +901,7 @@ fn load_to_stream_sync(one_shot_stream: &mut CubeScanOneShotStream) -> Result<()
899901
let auth = one_shot_stream.auth_context.clone();
900902
let transport = one_shot_stream.transport.clone();
901903
let meta = one_shot_stream.meta.clone();
904+
let schema = one_shot_stream.schema.clone();
902905
let options = one_shot_stream.options.clone();
903906
let wrapped_sql = one_shot_stream.wrapped_sql.clone();
904907

@@ -910,6 +913,7 @@ fn load_to_stream_sync(one_shot_stream: &mut CubeScanOneShotStream) -> Result<()
910913
auth,
911914
transport,
912915
meta,
916+
schema,
913917
options,
914918
wrapped_sql,
915919
))
@@ -1394,6 +1398,7 @@ mod tests {
13941398
_sql_query: Option<SqlQuery>,
13951399
_ctx: AuthContextRef,
13961400
_meta_fields: LoadRequestMeta,
1401+
_schema: SchemaRef,
13971402
) -> Result<V1LoadResponse, CubeError> {
13981403
let response = r#"
13991404
{

rust/cubesql/cubesql/src/compile/test/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,7 @@ impl TransportService for TestConnectionTransport {
804804
sql_query: Option<SqlQuery>,
805805
ctx: AuthContextRef,
806806
meta: LoadRequestMeta,
807+
_schema: SchemaRef,
807808
) -> Result<TransportLoadResponse, CubeError> {
808809
{
809810
let mut calls = self.load_calls.lock().await;

rust/cubesql/cubesql/src/transport/service.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ pub trait TransportService: Send + Sync + Debug {
142142
sql_query: Option<SqlQuery>,
143143
ctx: AuthContextRef,
144144
meta_fields: LoadRequestMeta,
145+
schema: SchemaRef,
145146
) -> Result<TransportLoadResponse, CubeError>;
146147

147148
async fn load_stream(
@@ -280,6 +281,7 @@ impl TransportService for HttpTransport {
280281
_sql_query: Option<SqlQuery>,
281282
ctx: AuthContextRef,
282283
meta: LoadRequestMeta,
284+
_schema: SchemaRef,
283285
) -> Result<TransportLoadResponse, CubeError> {
284286
if meta.change_user().is_some() {
285287
return Err(CubeError::internal(

0 commit comments

Comments
 (0)