Skip to content

Commit

Permalink
use relative file paths for CSV import in pinecone_medium_create.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarlaird committed Apr 8, 2024
1 parent 8fbff69 commit c597e29
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- run: psql test -c 'alter database test set enable_seqscan = off'

# setup the database for testing
- run: make installcheck REGRESS=pinecone_crud,pinecone_medium_create REGRESS_OPTS="--dbname=test --inputdir=./test --use-existing"
- run: make installcheck REGRESS="pinecone_crud pinecone_medium_create" REGRESS_OPTS="--dbname=test --inputdir=./test --use-existing"
- if: ${{ failure() }}
run: cat regression.diffs
# mac:
Expand Down
7 changes: 3 additions & 4 deletions test/expected/pinecone_medium_create.out
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ SET enable_seqscan = off;
DELETE FROM pinecone_mock;
-- CREATE TABLE
DROP TABLE IF EXISTS cities;
NOTICE: table "cities" does not exist, skipping
CREATE TABLE cities (name text, coords vector(3));
\o
-- COPY FROM CSV
copy cities(name, coords)
from '/home/oscar/cities_coordinates.csv'
delimiter ','
csv header;
\copy cities(name, coords) FROM './test/data/cities_coordinates.csv' WITH CSV HEADER DELIMITER ',';
-- CREATE INDEX
-- mock create index
INSERT INTO pinecone_mock (url_prefix, method, response)
Expand Down Expand Up @@ -63,3 +61,4 @@ SELECT name,coords<->'[0,0,1]' as dist FROM cities ORDER BY coords <-> '[0, 0, 1
Montreal | 0.7572697534412217
(5 rows)

DROP TABLE cities;
7 changes: 3 additions & 4 deletions test/sql/pinecone_medium_create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ CREATE TABLE cities (name text, coords vector(3));
\o

-- COPY FROM CSV
copy cities(name, coords)
from '/home/oscar/cities_coordinates.csv'
delimiter ','
csv header;
\copy cities(name, coords) FROM './test/data/cities_coordinates.csv' WITH CSV HEADER DELIMITER ',';

-- CREATE INDEX
-- mock create index
Expand Down Expand Up @@ -59,3 +56,5 @@ VALUES ('https://fakehost/query', 'POST', '{"results":[],"matches":[{"id":"00000
INSERT INTO pinecone_mock (url_prefix, method, response)
VALUES ('https://fakehost/vectors/fetch', 'GET', '{"code": 3, "message": "No IDs provided for fetch query", "details": [] }');
SELECT name,coords<->'[0,0,1]' as dist FROM cities ORDER BY coords <-> '[0, 0, 1]' limit 5;

DROP TABLE cities;

0 comments on commit c597e29

Please sign in to comment.