Skip to content

Commit ba502c6

Browse files
authored
Fix sample list error (clickhouse-only) (#11753)
* Fix sample list query for clickhouse * Change cancer study details query in sample list query * Clean up SampleListMapper.xml by removing unused prefix properties
1 parent 2d59ebe commit ba502c6

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/main/resources/org/cbioportal/legacy/persistence/mybatis/SampleListMapper.xml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,34 @@
44
<mapper namespace="org.cbioportal.legacy.persistence.mybatis.SampleListMapper">
55

66
<sql id="select">
7-
<!-- ROB: TODO : there is no GROUP BY clause in this file, so why were these problems? -->
8-
ANY_VALUE(sample_list.list_id) AS "${prefix}listId",
9-
ANY_VALUE(sample_list.stable_id) AS "${prefix}stableId"
7+
sample_list.list_id AS "listId",
8+
sample_list.stable_id AS "stableId"
109
<if test="projection == 'SUMMARY' || projection == 'DETAILED'">
1110
,
12-
ANY_VALUE(sample_list.cancer_study_id) AS "${prefix}cancerStudyId",
13-
ANY_VALUE(cancer_study.cancer_study_identifier) AS "${prefix}cancerStudyIdentifier",
14-
ANY_VALUE(sample_list.category) AS "${prefix}category",
15-
ANY_VALUE(sample_list.name) AS "${prefix}name",
16-
ANY_VALUE(sample_list.description) AS "${prefix}description"
11+
sample_list.cancer_study_id AS "cancerStudyId",
12+
cancer_study.cancer_study_identifier AS "cancerStudyIdentifier",
13+
sample_list.category AS "category",
14+
sample_list.name AS "name",
15+
sample_list.description AS "description"
1716
</if>
1817
<if test="projection == 'DETAILED'">
1918
,
20-
<include refid="org.cbioportal.legacy.persistence.mybatis.StudyMapper.select">
21-
<property name="prefix" value="${prefix}cancerStudy."/>
22-
</include>
19+
cancer_study.type_of_cancer_id AS "cancerStudy.typeOfCancerId",
20+
cancer_study.name AS "cancerStudy.name",
21+
cancer_study.description AS "cancerStudy.description",
22+
cancer_study.public AS "cancerStudy.publicStudy",
23+
cancer_study.pmid AS "cancerStudy.pmid",
24+
cancer_study.citation AS "cancerStudy.citation",
25+
cancer_study.groups AS "cancerStudy.groups",
26+
cancer_study.status AS "cancerStudy.status",
27+
cancer_study.import_date AS "cancerStudy.importDate",
28+
reference_genome.name AS "cancerStudy.referenceGenome"
2329
</if>
2430
</sql>
2531

2632
<select id="getAllSampleLists" resultType="org.cbioportal.legacy.model.SampleList">
2733
SELECT
28-
<include refid="select">
29-
<property name="prefix" value=""/>
30-
</include>
34+
<include refid="select"/>
3135
FROM sample_list
3236
INNER JOIN cancer_study ON sample_list.cancer_study_id = cancer_study.cancer_study_id
3337
INNER JOIN reference_genome ON cancer_study.reference_genome_id = reference_genome.reference_genome_id
@@ -63,9 +67,7 @@
6367

6468
<select id="getSampleList" resultType="org.cbioportal.legacy.model.SampleList">
6569
SELECT
66-
<include refid="select">
67-
<property name="prefix" value=""/>
68-
</include>
70+
<include refid="select"/>
6971
FROM sample_list
7072
INNER JOIN cancer_study ON sample_list.cancer_study_id = cancer_study.cancer_study_id
7173
INNER JOIN reference_genome ON cancer_study.reference_genome_id = reference_genome.reference_genome_id
@@ -74,9 +76,7 @@
7476

7577
<select id="getSampleLists" resultType="org.cbioportal.legacy.model.SampleList">
7678
SELECT
77-
<include refid="select">
78-
<property name="prefix" value=""/>
79-
</include>
79+
<include refid="select"/>
8080
FROM sample_list
8181
INNER JOIN cancer_study ON sample_list.cancer_study_id = cancer_study.cancer_study_id
8282
INNER JOIN reference_genome ON cancer_study.reference_genome_id = reference_genome.reference_genome_id

0 commit comments

Comments
 (0)