I tried to update the smoke example for develop branch. I changed the syntax to current setting, but the grounding SQL script failed here:
INSERT INTO dd_graph_variables(id, data_type, initial_value, is_evidence, cardinality)
SELECT people.id, 'Boolean', people.smokes::int, (people.smokes IS NOT NULL), null
FROM people;
DROP TABLE IF EXISTS people_smokes_cardinality CASCADE;
CREATE TABLE people_smokes_cardinality(people_smokes_cardinality) AS VALUES (1) WITH DATA;
INSERT INTO dd_graph_variables(id, data_type, initial_value, is_evidence, cardinality)
SELECT people.id, 'Boolean', people.has_cancer::int, (people.has_cancer IS NOT NULL), null
FROM people;
DROP TABLE IF EXISTS people_has_cancer_cardinality CASCADE;
CREATE TABLE people_has_cancer_cardinality(people_has_cancer_cardinality) AS VALUES (1) WITH DATA;
INSERT INTO dd_graph_variables_map(variable_id)
SELECT id FROM dd_graph_variables;
INSERT INTO dd_graph_variables_holdout(variable_id)
SELECT id FROM dd_graph_variables
WHERE RANDOM() < 0.0 AND is_evidence = true;
UPDATE dd_graph_variables SET is_evidence=false
WHERE dd_graph_variables.id IN (SELECT variable_id FROM dd_graph_variables_holdout);
21:53:48.558 [default-dispatcher-2][PostgresInferenceDataStoreComponent$PostgresInferenceDataStore(akka://deepdive)][PostgresInferenceDataStoreComponent$PostgresInferenceDataStore] INFO Executing grounding query...
21:53:57.533 [][][StatementExecutor$$anon$1] ERROR SQL execution failed (Reason: ERROR: duplicate key violates unique constraint "dd_graph_variables_pkey" (seg20 rulk.stanford.edu:40000 pid=25436)):
DROP TABLE IF EXISTS people_smokes_cardinality CASCADE;CREATE TABLE people_smokes_cardinality(people_smokes_cardinality) AS VALUES (1) WITH DATA;INSERT INTO dd_graph_variables(id, data_type, initial_value, is_evidence, cardinality) SELECT people.id, 'Boolean', people.has_cancer::int, (people.has_cancer IS NOT NULL), null FROM people
21:53:57.558 [default-dispatcher-2][PostgresInferenceDataStoreComponent$PostgresInferenceDataStore(akka://deepdive)][PostgresInferenceDataStoreComponent$PostgresInferenceDataStore] ERROR org.postgresql.util.PSQLException: ERROR: duplicate key violates unique constraint "dd_graph_variables_pkey" (seg20 rulk.stanford.edu:40000 pid=25436)
21:53:57.559 [default-dispatcher-2][PostgresInferenceDataStoreComponent$PostgresInferenceDataStore(akka://deepdive)][PostgresInferenceDataStoreComponent$PostgresInferenceDataStore] INFO [Error] Please check the SQL cmd!
21:53:57.644 [default-dispatcher-5][inferenceManager][OneForOneStrategy] ERROR ERROR: duplicate key violates unique constraint "dd_graph_variables_pkey" (seg20 rulk.stanford.edu:40000 pid=25436)
org.postgresql.util.PSQLException: ERROR: duplicate key violates unique constraint "dd_graph_variables_pkey" (seg20 rulk.stanford.edu:40000 pid=25436)
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157) ~[postgresql-9.2-1003-jdbc4.jar:na]