Skip to content

Commit 73bced9

Browse files
committed
pass SchemaRef to load methods.
1 parent 91c5571 commit 73bced9

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
@@ -665,6 +665,7 @@ impl ExecutionPlan for CubeScanExecutionPlan {
665665
self.auth_context.clone(),
666666
self.transport.clone(),
667667
meta.clone(),
668+
self.schema.clone(),
668669
self.options.clone(),
669670
self.wrapped_sql.clone(),
670671
)
@@ -847,6 +848,7 @@ async fn load_data(
847848
auth_context: AuthContextRef,
848849
transport: Arc<dyn TransportService>,
849850
meta: LoadRequestMeta,
851+
schema: SchemaRef,
850852
options: CubeScanOptions,
851853
sql_query: Option<SqlQuery>,
852854
) -> ArrowResult<V1LoadResult> {
@@ -878,7 +880,7 @@ async fn load_data(
878880
)
879881
} else {
880882
let result = transport
881-
.load(span_id, request, sql_query, auth_context, meta)
883+
.load(span_id, request, sql_query, auth_context, meta, schema)
882884
.await;
883885
let mut response = result.map_err(|err| ArrowError::ComputeError(err.to_string()))?;
884886
if let Some(data) = response.results.pop() {
@@ -906,6 +908,7 @@ fn load_to_stream_sync(one_shot_stream: &mut CubeScanOneShotStream) -> Result<()
906908
let auth = one_shot_stream.auth_context.clone();
907909
let transport = one_shot_stream.transport.clone();
908910
let meta = one_shot_stream.meta.clone();
911+
let schema = one_shot_stream.schema.clone();
909912
let options = one_shot_stream.options.clone();
910913
let wrapped_sql = one_shot_stream.wrapped_sql.clone();
911914

@@ -917,6 +920,7 @@ fn load_to_stream_sync(one_shot_stream: &mut CubeScanOneShotStream) -> Result<()
917920
auth,
918921
transport,
919922
meta,
923+
schema,
920924
options,
921925
wrapped_sql,
922926
))
@@ -1401,6 +1405,7 @@ mod tests {
14011405
_sql_query: Option<SqlQuery>,
14021406
_ctx: AuthContextRef,
14031407
_meta_fields: LoadRequestMeta,
1408+
_schema: SchemaRef,
14041409
) -> Result<V1LoadResponse, CubeError> {
14051410
let response = r#"
14061411
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ impl TransportService for TestConnectionTransport {
790790
sql_query: Option<SqlQuery>,
791791
ctx: AuthContextRef,
792792
meta: LoadRequestMeta,
793+
_schema: SchemaRef,
793794
) -> Result<TransportLoadResponse, CubeError> {
794795
{
795796
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)