Skip to content

Commit

Permalink
tests: add some bam sqllogictests (#187)
Browse files Browse the repository at this point in the history
* tests: add some bam sqllogictests
* test: add sam tests
  • Loading branch information
tshauck authored Sep 27, 2023
1 parent 49fbb36 commit 5726c0c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
19 changes: 19 additions & 0 deletions exon/tests/sqllogictests/slt/bam-select-tests.slt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
control substitution on

statement ok
CREATE EXTERNAL TABLE bam STORED AS BAM LOCATION '$CARGO_MANIFEST_DIR/test-data/datasources/bam/test.bam';

query T
SELECT name, flag, reference, start, end, mapping_quality, cigar, mate_reference FROM bam LIMIT 1;
----
READ_ID 83 chr1 12203704 12217173 NULL 55M13394N21M chr1

query T
SELECT sequence FROM bam LIMIT 1;
----
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

query T
SELECT quality_score FROM bam LIMIT 1;
----
8DCCCC?::>CDDB<<>@3CCDBD@DBDFHHHFEIIGCAIIHIF@@DDGGEBEGEIHGGGDGG?BHHHDFFFF@@<
22 changes: 22 additions & 0 deletions exon/tests/sqllogictests/slt/sam-select-tests.slt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
control substitution on

statement ok
CREATE EXTERNAL TABLE sam STORED AS SAM LOCATION '$CARGO_MANIFEST_DIR/test-data/datasources/sam/test.sam';

query T
SELECT name, flag, reference, start, end, mapping_quality, cigar, mate_reference FROM sam LIMIT 1;
----
ref1_grp1_p001 99 ref1 1 10 0 10M ref1

query T
SELECT sequence FROM sam LIMIT 1;
----
CGAGCTCGGT

query T
SELECT quality_score FROM sam LIMIT 1;
----
!!!!!!!!!!

statement ok
DROP TABLE sam;

0 comments on commit 5726c0c

Please sign in to comment.