Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update base64 lib and fix compilation failure in flight_sql.rs #896

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 8 additions & 2 deletions ballista/core/src/serde/scheduler/to_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,18 @@ impl TryInto<protobuf::OperatorMetric> for &MetricValue {
}),
MetricValue::StartTimestamp(timestamp) => Ok(protobuf::OperatorMetric {
metric: Some(operator_metric::Metric::StartTimestamp(
timestamp.value().map(|m| m.timestamp_nanos()).unwrap_or(0),
timestamp
.value()
.map(|m| m.timestamp_nanos_opt().unwrap())
.unwrap_or(0),
)),
}),
MetricValue::EndTimestamp(timestamp) => Ok(protobuf::OperatorMetric {
metric: Some(operator_metric::Metric::EndTimestamp(
timestamp.value().map(|m| m.timestamp_nanos()).unwrap_or(0),
timestamp
.value()
.map(|m| m.timestamp_nanos_opt().unwrap())
.unwrap_or(0),
)),
}),
}
Expand Down
2 changes: 1 addition & 1 deletion ballista/scheduler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ arrow-flight = { workspace = true }
async-recursion = "1.0.0"
async-trait = "0.1.41"
ballista-core = { path = "../core", version = "0.11.0", features = ["s3"] }
base64 = { version = "0.13", default-features = false }
base64 = { version = "0.21", default-features = false }
clap = { version = "3", features = ["derive", "cargo"] }
configure_me = { workspace = true }
dashmap = "5.4.0"
Expand Down
4 changes: 3 additions & 1 deletion ballista/scheduler/src/flight_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use arrow_flight::{
Action, FlightData, FlightDescriptor, FlightEndpoint, FlightInfo, HandshakeRequest,
HandshakeResponse, Location, Ticket,
};
use base64::{engine::general_purpose, Engine as _};
use log::{debug, error, warn};
use std::convert::TryFrom;
use std::pin::Pin;
Expand Down Expand Up @@ -504,7 +505,8 @@ impl FlightSqlService for FlightSqlServiceImpl {
)))?;
}
let base64 = &authorization[basic.len()..];
let bytes = base64::decode(base64)
let bytes = general_purpose::STANDARD
.decode(base64)
.map_err(|_| Status::invalid_argument("authorization not parsable"))?;
let str = String::from_utf8(bytes)
.map_err(|_| Status::invalid_argument("authorization not parsable"))?;
Expand Down
Loading