  SELECT
-  vars.call_set_name,
-  ref.chromosome,
-  ref.start,
-  ref.end,
-  ref.reference_bases,
-  vars.var_start,
-  vars.var_end,
-  
-  #vars.variant_called_count,
+  vars.call_set_name AS sample_name,
+  ref.chromosome AS chromosome,
+  ref.start AS start,
+  vars.var_end AS end,
+  ref.reference_bases AS reference_bases,
 FROM (
   SELECT  
     CONCAT('chr', Chr) AS chromosome,

        end AS var_end,
        INTEGER(FLOOR(start / 5000)) AS bin,
        reference_bases,
        #SUM(called_count) AS variant_called_count,
      FROM ( FLATTEN((
        # _LIMIT the query to SNPs
        SELECT
          call.call_set_name,
          reference_name as chromosome,

    Chr = '17'
    AND Start BETWEEN 41196311
      AND 41277499 ) AS ref 
JOIN (
SELECT
        call.call_set_name AS call_set_name,
