Skip to content

Commit

Permalink
Use pk in producer_worker of embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
var77 committed Mar 26, 2024
1 parent 81a5dbc commit 810fc87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lantern_cli/src/embeddings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ fn producer_worker(
let column = &args.column;
let schema = &args.schema;
let table = &args.table;
let pk = &args.pk;
let full_table_name = get_full_table_name(schema, table);

let filter_sql = if args.filter.is_some() {
Expand Down Expand Up @@ -105,8 +106,9 @@ fn producer_worker(
// With portal we can execute a query and poll values from it in chunks
let portal = transaction.bind(
&format!(
"SELECT id::text, {column}::text FROM {full_table_name} {filter_sql} {limit_sql};",
"SELECT {pk}::text, {column}::text FROM {full_table_name} {filter_sql} {limit_sql};",
column = quote_ident(column),
pk = quote_ident(pk)
),
&[],
)?;
Expand Down
2 changes: 1 addition & 1 deletion lantern_cli/tests/daemon_test_with_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use lantern_cli::daemon::{
};
use tokio_postgres::{Client, NoTls};

static EMB_LOCK_TABLE_NAME: &'static str = "_lantern_emb_job_locks";
// static EMB_LOCK_TABLE_NAME: &'static str = "_lantern_emb_job_locks";
static EMBEDDING_JOBS_TABLE_NAME: &'static str = "_daemon_embedding_jobs";
static AUTOTUNE_JOBS_TABLE_NAME: &'static str = "_daemon_autotune_jobs";
static INDEX_JOBS_TABLE_NAME: &'static str = "_daemon_index_jobs";
Expand Down

0 comments on commit 810fc87

Please sign in to comment.