fix: i64→i32 for INT4 cols (identity_binding, identity_agent, qdrant_db)
This commit is contained in:
@@ -274,7 +274,7 @@ async fn match_from_trace(
|
|||||||
// 1. Get 3 best face embeddings from this trace at different angles
|
// 1. Get 3 best face embeddings from this trace at different angles
|
||||||
// Divide trace frame range into 3 segments, pick best face from each
|
// Divide trace frame range into 3 segments, pick best face from each
|
||||||
let fd_table = schema::table_name("face_detections");
|
let fd_table = schema::table_name("face_detections");
|
||||||
let all_faces: Vec<(Vec<f32>, i64)> = sqlx::query_as::<_, (Vec<f32>, i64)>(&format!(
|
let all_faces: Vec<(Vec<f32>, i32)> = sqlx::query_as::<_, (Vec<f32>, i32)>(&format!(
|
||||||
"SELECT embedding, frame_number FROM {} \
|
"SELECT embedding, frame_number FROM {} \
|
||||||
WHERE file_uuid = $1 AND trace_id = $2 AND embedding IS NOT NULL \
|
WHERE file_uuid = $1 AND trace_id = $2 AND embedding IS NOT NULL \
|
||||||
ORDER BY frame_number ASC",
|
ORDER BY frame_number ASC",
|
||||||
@@ -311,7 +311,7 @@ async fn match_from_trace(
|
|||||||
let mut query_embeddings: Vec<Vec<f32>> = Vec::new();
|
let mut query_embeddings: Vec<Vec<f32>> = Vec::new();
|
||||||
|
|
||||||
// Get width*height info if available (not all pipelines store it)
|
// Get width*height info if available (not all pipelines store it)
|
||||||
let face_sizes: Vec<(i64, i32)> = sqlx::query_as::<_, (i64, i32)>(&format!(
|
let face_sizes: Vec<(i32, i32)> = sqlx::query_as::<_, (i32, i32)>(&format!(
|
||||||
"SELECT frame_number, COALESCE(width, 0) * COALESCE(height, 0) AS area \
|
"SELECT frame_number, COALESCE(width, 0) * COALESCE(height, 0) AS area \
|
||||||
FROM {} WHERE file_uuid = $1 AND trace_id = $2 AND embedding IS NOT NULL \
|
FROM {} WHERE file_uuid = $1 AND trace_id = $2 AND embedding IS NOT NULL \
|
||||||
ORDER BY frame_number ASC",
|
ORDER BY frame_number ASC",
|
||||||
@@ -323,7 +323,7 @@ async fn match_from_trace(
|
|||||||
.await
|
.await
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
let face_sizes_map: std::collections::HashMap<i64, i32> = face_sizes.into_iter().collect();
|
let face_sizes_map: std::collections::HashMap<i32, i32> = face_sizes.into_iter().collect();
|
||||||
|
|
||||||
for (start, end) in segments {
|
for (start, end) in segments {
|
||||||
let seg_start = start.min(total - 1);
|
let seg_start = start.min(total - 1);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ pub async fn bind_identity(
|
|||||||
})?;
|
})?;
|
||||||
|
|
||||||
// Get identity_id from identity_uuid
|
// Get identity_id from identity_uuid
|
||||||
let identity_row: Option<(i64, String)> = sqlx::query_as(&format!(
|
let identity_row: Option<(i32, String)> = sqlx::query_as(&format!(
|
||||||
"SELECT id, name FROM {} WHERE uuid = $1::uuid",
|
"SELECT id, name FROM {} WHERE uuid = $1::uuid",
|
||||||
id_table
|
id_table
|
||||||
))
|
))
|
||||||
@@ -234,7 +234,7 @@ pub async fn merge_identities(
|
|||||||
})?;
|
})?;
|
||||||
|
|
||||||
// Get IDs for both identities
|
// Get IDs for both identities
|
||||||
let from_row: Option<(i64, String)> = sqlx::query_as(&format!(
|
let from_row: Option<(i32, String)> = sqlx::query_as(&format!(
|
||||||
"SELECT id, name FROM {} WHERE uuid = $1::uuid",
|
"SELECT id, name FROM {} WHERE uuid = $1::uuid",
|
||||||
id_table
|
id_table
|
||||||
))
|
))
|
||||||
@@ -252,7 +252,7 @@ pub async fn merge_identities(
|
|||||||
Json(serde_json::json!({"error": "Source identity not found"})),
|
Json(serde_json::json!({"error": "Source identity not found"})),
|
||||||
))?;
|
))?;
|
||||||
|
|
||||||
let into_row: Option<(i64, String)> = sqlx::query_as(&format!(
|
let into_row: Option<(i32, String)> = sqlx::query_as(&format!(
|
||||||
"SELECT id, name FROM {} WHERE uuid = $1::uuid",
|
"SELECT id, name FROM {} WHERE uuid = $1::uuid",
|
||||||
id_table
|
id_table
|
||||||
))
|
))
|
||||||
@@ -405,8 +405,8 @@ pub async fn bind_identity_trace(
|
|||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let identity_row: Option<(i64, String)> = sqlx::query_as(&format!(
|
let identity_row: Option<(i32, String)> = sqlx::query_as(&format!(
|
||||||
"SELECT id::bigint, name FROM {} WHERE uuid = $1::uuid",
|
"SELECT id, name FROM {} WHERE uuid = $1::uuid",
|
||||||
id_table
|
id_table
|
||||||
))
|
))
|
||||||
.bind(&identity_uuid)
|
.bind(&identity_uuid)
|
||||||
|
|||||||
@@ -758,7 +758,7 @@ impl QdrantDb {
|
|||||||
vector: &[f32],
|
vector: &[f32],
|
||||||
file_uuid: &str,
|
file_uuid: &str,
|
||||||
trace_id: i32,
|
trace_id: i32,
|
||||||
frame_number: i64,
|
frame_number: i32,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let url = format!(
|
let url = format!(
|
||||||
"{}/collections/{}/points?wait=true",
|
"{}/collections/{}/points?wait=true",
|
||||||
@@ -889,7 +889,7 @@ pub async fn sync_face_embeddings(file_uuid: &str) -> Result<()> {
|
|||||||
for row in &rows {
|
for row in &rows {
|
||||||
let id: i32 = row.get(0);
|
let id: i32 = row.get(0);
|
||||||
let trace_id: Option<i32> = row.get(1);
|
let trace_id: Option<i32> = row.get(1);
|
||||||
let frame_number: i64 = row.get(2);
|
let frame_number: i32 = row.get(2);
|
||||||
let embedding: Option<Vec<f32>> = row.get(3);
|
let embedding: Option<Vec<f32>> = row.get(3);
|
||||||
|
|
||||||
if let (Some(emb), Some(tid)) = (embedding, trace_id) {
|
if let (Some(emb), Some(tid)) = (embedding, trace_id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user