Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions crates/queryflux-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@ pub struct FrontendsConfig {
pub clickhouse_http: Option<FrontendConfig>,
#[serde(default)]
pub flight_sql: Option<FrontendConfig>,
#[serde(default)]
pub snowflake_http: Option<FrontendConfig>,
#[serde(default)]
pub snowflake_sql_api: Option<FrontendConfig>,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
}
Comment on lines +322 to 335

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FrontendsConfig introduces a separate snowflakeSqlApi frontend config block, but the implementation serves the Snowflake SQL API routes on the same listener as snowflakeHttp (see SnowflakeFrontend::router().merge(sql_api::routes()) and main.rs only binds snowflake_http). This makes config misleading and can cause the admin/UI to report SQL API as disabled/unconfigured even when it is actually reachable. Consider removing snowflake_sql_api from FrontendsConfig entirely, or clearly defining it as an alias of snowflake_http (same enabled + port) and enforcing that invariant in config parsing/validation.

Copilot uses AI. Check for mistakes.

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down Expand Up @@ -648,6 +652,12 @@ pub enum RouterConfig {
mysql_wire: Option<String>,
#[serde(default)]
clickhouse_http: Option<String>,
#[serde(default)]
flight_sql: Option<String>,
#[serde(default)]
snowflake_http: Option<String>,
#[serde(default)]
snowflake_sql_api: Option<String>,
},
#[serde(rename_all = "camelCase")]
Header {
Expand Down
6 changes: 6 additions & 0 deletions crates/queryflux-core/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ pub enum FrontendProtocol {
MySqlWire,
ClickHouseHttp,
FlightSql,
/// Snowflake internal wire protocol used by JDBC/ODBC/Python/Go/Node.js connectors.
SnowflakeHttp,
/// Snowflake public SQL REST API v2 (/api/v2/statements).
SnowflakeSqlApi,
}

impl FrontendProtocol {
Expand All @@ -78,6 +82,8 @@ impl FrontendProtocol {
FrontendProtocol::MySqlWire => SqlDialect::MySql,
FrontendProtocol::ClickHouseHttp => SqlDialect::ClickHouse,
FrontendProtocol::FlightSql => SqlDialect::Generic,
FrontendProtocol::SnowflakeHttp => SqlDialect::Generic,
FrontendProtocol::SnowflakeSqlApi => SqlDialect::Generic,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/queryflux-e2e-tests/src/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use queryflux_engine_adapters::{
starrocks::StarRocksAdapter, trino::TrinoAdapter, EngineAdapterTrait,
};
use queryflux_frontend::{
snowflake::http::session_store::SnowflakeSessionStore,
state::LiveConfig,
trino_http::{state::AppState, TrinoHttpFrontend},
};
Expand Down Expand Up @@ -230,6 +231,7 @@ impl TestHarness {
auth_provider: Arc::new(NoneAuthProvider::new(false)) as Arc<dyn AuthProvider>,
authorization: Arc::new(AllowAllAuthorization) as Arc<dyn AuthorizationChecker>,
identity_resolver: Arc::new(BackendIdentityResolver::new()),
snowflake_sessions: SnowflakeSessionStore::new(),
});

let router: Router = TrinoHttpFrontend::new(state, port).router();
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Expand Down
7 changes: 7 additions & 0 deletions crates/queryflux-frontend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ arrow-flight = { version = "58.1.0", features = ["flight-sql"] }
arrow-ipc = "58.1.0"
tonic = { version = "0.14.5", features = ["transport"] }
prost = "0.14.3"
dashmap = { workspace = true }
jsonwebtoken = "9"
rsa = "0.9"
sha2 = "0.10"
Comment on lines +36 to +38

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This crate now depends on jsonwebtoken = "9" while queryflux-auth uses jsonwebtoken = "10.3.0", resulting in two versions in the build (larger compile graph and binary). Additionally, rsa/sha2/jsonwebtoken appear to be used only by snowflake/sql_api/auth.rs, which is not wired into the module tree. Consider either (a) wiring the auth helper into the Snowflake implementation and upgrading to the workspace’s jsonwebtoken version, or (b) removing the unused module + dependencies to avoid unnecessary build/binary cost.

Suggested change
jsonwebtoken = "9"
rsa = "0.9"
sha2 = "0.10"

Copilot uses AI. Check for mistakes.
uuid = { version = "1", features = ["v4"] }
base64 = "0.22"
flate2 = "1"
12 changes: 12 additions & 0 deletions crates/queryflux-frontend/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,18 @@ pub fn build_frontends_status(
"Arrow Flight SQL / gRPC-style access (driver-dependent).",
frontends.flight_sql.as_ref(),
),
opt_fe(
"snowflake_http",
"Snowflake HTTP (wire)",
"Snowflake internal HTTP wire protocol (JDBC/ODBC/Python/Go/Node.js connectors).",
frontends.snowflake_http.as_ref(),
),
opt_fe(
"snowflake_sql_api",
"Snowflake SQL API",
"Snowflake REST SQL API v2 (POST /api/v2/statements).",
frontends.snowflake_sql_api.as_ref(),

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/admin/frontends currently reports snowflake_sql_api based on frontends.snowflake_sql_api, but the SQL API endpoints are always served by the Snowflake listener created from frontends.snowflake_http (single port). This will produce incorrect UI status (SQL API shown off/not configured while it is actually available). Suggest deriving the snowflake_sql_api status from snowflake_http (same enabled/port) or removing the separate entry unless a distinct listener is actually implemented.

Suggested change
frontends.snowflake_sql_api.as_ref(),
frontends.snowflake_http.as_ref(),

Copilot uses AI. Check for mistakes.
),
];

FrontendsStatusDto {
Expand Down
1 change: 1 addition & 0 deletions crates/queryflux-frontend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod dispatch;
pub mod flight_sql;
pub mod mysql_wire;
pub mod postgres_wire;
pub mod snowflake;
pub mod state;
pub mod trino_http;

Expand Down
Loading
Loading