Hi team,
I got an error message when run Characterizations in Atlas (see below). Need help to fix it. Thanks
org.ohdsi.webapi.exception.AtlasException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.springframework.jdbc.Uncategorized SQLException: StatementCallback; uncategorized
SQLException for SQL [<START_WITH>t1 AS (
SELECT cohort_definition_id,
COUNT() AS cnt
FROM tmp_v0224.temp_cohort_b4890s3e
WHERE cohort_definition_id IN (422)
GROUP BY cohort_definition_id
),
t2 AS (
SELECT cohort_definition_id,
COUNT() AS cnt,
MIN(concept_count) AS min_concept_count,
MAX(concept_count) AS max_concept_count,
SUM(CAST(concept_count AS BIGINT)) AS sum_concept_count,
SUM(CAST(concept_count AS BIGINT) * CAST(concept_count AS BIGINT)) AS squared_concept_count
FROM tmp_v0224.b4890s3econcept_count_data
GROUP BY cohort_definition_id
)
<END_WITH>
CREATE TABLE tmp_v0224.b4890s3econcept_count_stats
USING DELTA
AS
(SELECT
t1.cohort_definition_id,
CASE WHEN t2.cnt = t1.cnt THEN t2.min_concept_count ELSE 0 END AS min_value,
t2.max_concept_count AS max_value,
CAST(t2.sum_concept_count / (1.0 * t1.cnt) AS FLOAT) AS average_value,
CAST(CASE
WHEN t2.cnt = 1 THEN 0
ELSE SQRT((1.0 * t2.cntt2.squared_concept_count - 1.0 * t2.sum_concept_countt2.sum_concept_count) / (1.0 * t2.cnt*(1.0 * t2.cnt - 1)))
END AS FLOAT) AS standard_deviation,
t2.cnt AS count_value,
t1.cnt - t2.cnt AS count_no_value,
t1.cnt AS population_size
FROM
t1
INNER JOIN t2
ON t1.cohort_definition_id = t2.cohort_definition_id)]; SQL state [HY000]; error code [500051]; [Simba]SparkJDBCDriver ERROR processing query/statement. Error Code: 0, SQL state: org.apache.hive.service.cli.HiveSQLException: Error running query: [PARSE_SYNTAX_ERROR] org.apache.spark.sql.catalyst.parser.ParseException:
[PARSE_SYNTAX_ERROR] Syntax error at or near ‘<’.(line 1, pos 0)
== SQL ==
<START_WITH>t1 AS (
^^^
SELECT cohort_definition_id,
COUNT() AS cnt
FROM tmp_v0224.temp_cohort_b4890s3e
WHERE cohort_definition_id IN (422)
GROUP BY cohort_definition_id
),
t2 AS (
SELECT cohort_definition_id,
COUNT() AS cnt,
MIN(concept_count) AS min_concept_count,
MAX(concept_count) AS max_concept_count,
SUM(CAST(concept_count AS BIGINT)) AS sum_concept_count,
SUM(CAST(concept_count AS BIGINT) * CAST(concept_count AS BIGINT)) AS squared_concept_count
FROM tmp_v0224.b4890s3econcept_count_data
GROUP BY cohort_definition_id
)
<END_WITH>
CREATE TABLE tmp_v0224.b4890s3econcept_count_stats
USING DELTA
AS
(SELECT
t1.cohort_definition_id,
CASE WHEN t2.cnt = t1.cnt THEN t2.min_co