Skip to content

Commit aa42911

Browse files
committed
update fedquery
1 parent 67d568c commit aa42911

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed
10.1 KB
Binary file not shown.

connectorx/src/fed_rewriter.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ fn create_sources(jvm: &Jvm, db_map: &HashMap<String, FederatedDataSourceInfo>)
8080
debug!("url: {:?}", url);
8181
let ds = match source_conn.ty {
8282
SourceType::Postgres => jvm.invoke_static(
83-
"org.apache.calcite.adapter.jdbc.JdbcSchema",
84-
"dataSource",
83+
"ai.dataprep.federated.FederatedQueryRewriter",
84+
"createDataSource",
8585
&[
8686
InvocationArg::try_from(format!(
8787
"jdbc:postgresql://{}:{}{}",
@@ -96,8 +96,8 @@ fn create_sources(jvm: &Jvm, db_map: &HashMap<String, FederatedDataSourceInfo>)
9696
],
9797
)?,
9898
SourceType::MySQL => jvm.invoke_static(
99-
"org.apache.calcite.adapter.jdbc.JdbcSchema",
100-
"dataSource",
99+
"ai.dataprep.federated.FederatedQueryRewriter",
100+
"createDataSource",
101101
&[
102102
InvocationArg::try_from(format!(
103103
"jdbc:mysql://{}:{}{}",
@@ -112,8 +112,8 @@ fn create_sources(jvm: &Jvm, db_map: &HashMap<String, FederatedDataSourceInfo>)
112112
],
113113
)?,
114114
SourceType::DuckDB => jvm.invoke_static(
115-
"org.apache.calcite.adapter.jdbc.JdbcSchema",
116-
"dataSource",
115+
"ai.dataprep.federated.FederatedQueryRewriter",
116+
"createDataSource",
117117
&[
118118
InvocationArg::try_from(format!("jdbc:duckdb:{}", url.path())).unwrap(),
119119
InvocationArg::try_from(DUCKDB_JDBC_DRIVER).unwrap(),
@@ -126,6 +126,7 @@ fn create_sources(jvm: &Jvm, db_map: &HashMap<String, FederatedDataSourceInfo>)
126126
let fed_ds = jvm.create_instance(
127127
"ai.dataprep.federated.FederatedDataSource",
128128
&[
129+
InvocationArg::try_from(url.scheme()).unwrap(),
129130
InvocationArg::try_from(ds).unwrap(),
130131
InvocationArg::try_from(db_info.is_local).unwrap(),
131132
],

federated-query

0 commit comments

Comments
 (0)