Skip to content

Commit 9f6ee1b

Browse files
committed
pass SchemaRef to load methods.
1 parent b7a398e commit 9f6ee1b

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
)
@@ -844,6 +845,7 @@ async fn load_data(
844845
auth_context: AuthContextRef,
845846
transport: Arc<dyn TransportService>,
846847
meta: LoadRequestMeta,
848+
schema: SchemaRef,
847849
options: CubeScanOptions,
848850
sql_query: Option<SqlQuery>,
849851
) -> ArrowResult<V1LoadResult> {
@@ -875,7 +877,7 @@ async fn load_data(
875877
)
876878
} else {
877879
let result = transport
878-
.load(span_id, request, sql_query, auth_context, meta)
880+
.load(span_id, request, sql_query, auth_context, meta, schema)
879881
.await;
880882
let mut response = result.map_err(|err| ArrowError::ComputeError(err.to_string()))?;
881883
if let Some(data) = response.results.pop() {
@@ -903,6 +905,7 @@ fn load_to_stream_sync(one_shot_stream: &mut CubeScanOneShotStream) -> Result<()
903905
let auth = one_shot_stream.auth_context.clone();
904906
let transport = one_shot_stream.transport.clone();
905907
let meta = one_shot_stream.meta.clone();
908+
let schema = one_shot_stream.schema.clone();
906909
let options = one_shot_stream.options.clone();
907910
let wrapped_sql = one_shot_stream.wrapped_sql.clone();
908911

@@ -914,6 +917,7 @@ fn load_to_stream_sync(one_shot_stream: &mut CubeScanOneShotStream) -> Result<()
914917
auth,
915918
transport,
916919
meta,
920+
schema,
917921
options,
918922
wrapped_sql,
919923
))
@@ -1398,6 +1402,7 @@ mod tests {
13981402
_sql_query: Option<SqlQuery>,
13991403
_ctx: AuthContextRef,
14001404
_meta_fields: LoadRequestMeta,
1405+
_schema: SchemaRef,
14011406
) -> Result<V1LoadResponse, CubeError> {
14021407
let response = r#"
14031408
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ impl TransportService for TestConnectionTransport {
801801
sql_query: Option<SqlQuery>,
802802
ctx: AuthContextRef,
803803
meta: LoadRequestMeta,
804+
_schema: SchemaRef,
804805
) -> Result<TransportLoadResponse, CubeError> {
805806
{
806807
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)