diff --git a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml index 95e66f20d3c..64501bf74ee 100644 --- a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml +++ b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml @@ -337,7 +337,7 @@ SELECT DISTINCT ${unique_id} - FROM sample_derived sd + FROM () AS sd LEFT JOIN () AS categorical_clinical_data ON @@ -428,7 +428,7 @@ ( SELECT ${unique_id} - FROM sample_derived sd + FROM () AS sd LEFT JOIN () AS categorical_clinical_data ON @@ -462,6 +462,23 @@ ) + + + SELECT DISTINCT sample_query.sample_unique_id + + FROM () AS sample_query + LEFT JOIN () AS cna_query ON sample_query.sample_unique_id = cna_query.sample_unique_id + WHERE + + + + alteration_value IS null + + alteration_value == #{dataFilterValue.value} + + + + @@ -478,9 +495,9 @@ - SELECT DISTINCT sd.sample_unique_id - FROM sample_derived sd - LEFT JOIN () AS genomic_numerical_query ON sd.sample_unique_id = genomic_numerical_query.sample_unique_id + SELECT DISTINCT sample_query.sample_unique_id + FROM () AS sample_query + LEFT JOIN () AS genomic_numerical_query ON sample_query.sample_unique_id = genomic_numerical_query.sample_unique_id WHERE alteration_value IS null @@ -490,7 +507,7 @@ SELECT DISTINCT sample_unique_id - FROM () AS genomic_numerical_query + FROM () AS genomic_numerical_query WHERE @@ -536,7 +553,7 @@ - + SELECT sample_unique_id, alteration_value FROM genetic_alteration_derived WHERE profile_type = #{genomicDataFilter.profileType} @@ -546,6 +563,15 @@ #{studyId} + + + SELECT sample_unique_id + FROM sample_derived + WHERE cancer_study_identifier IN + + #{studyId} + + SELECT sample_unique_id, value, datatype @@ -572,7 +598,7 @@ SELECT DISTINCT sd.sample_unique_id - FROM sample_derived sd + FROM () AS sd LEFT JOIN () AS generic_numerical_query ON sd.sample_unique_id = generic_numerical_query.sample_unique_id WHERE datatype = 'LIMIT-VALUE' AND value IS null OR @@ -646,7 +672,7 @@ SELECT ${unique_id} - FROM sample_derived sd + FROM () AS sd LEFT JOIN () AS generic_assay_query ON sd.sample_unique_id = generic_assay_query.sample_unique_id @@ -735,34 +761,4 @@ - - - - WITH cna_query AS ( - SELECT sample_unique_id, alteration_value - FROM genetic_alteration_derived - WHERE profile_type = #{genomicDataFilter.profileType} - AND hugo_gene_symbol = #{genomicDataFilter.hugoGeneSymbol} - AND cancer_study_identifier IN - - #{studyId} - - ) - SELECT DISTINCT sd.sample_unique_id - - FROM sample_derived sd - LEFT JOIN cna_query ON sd.sample_unique_id = cna_query.sample_unique_id - WHERE cancer_study_identifier IN - - #{studyId} - - - - - alteration_value IS null - - alteration_value == #{dataFilterValue.value} - - - \ No newline at end of file