From 00f6500d37a1fad560f02015ebb313c699ad45fa Mon Sep 17 00:00:00 2001 From: Benjamin De Boe Date: Thu, 29 Feb 2024 11:08:20 +0100 Subject: [PATCH 1/8] initial support for InterSystems IRIS --- .../java/org/ohdsi/webapi/DataAccessConfig.java | 2 +- src/main/resources/i18n/messages_en.json | 3 ++- src/main/resources/i18n/messages_ko.json | 3 ++- src/main/resources/i18n/messages_ru.json | 3 ++- src/main/resources/i18n/messages_zh.json | 3 ++- .../ohdsi/webapi/util/DataSourceDTOParserTest.java | 14 ++++++++++++++ 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/ohdsi/webapi/DataAccessConfig.java b/src/main/java/org/ohdsi/webapi/DataAccessConfig.java index 8bc4e438dc..aac8f7a7e0 100644 --- a/src/main/java/org/ohdsi/webapi/DataAccessConfig.java +++ b/src/main/java/org/ohdsi/webapi/DataAccessConfig.java @@ -82,7 +82,7 @@ public DataSource primaryDataSource() { //note autocommit defaults vary across vendors. use provided @Autowired TransactionTemplate String[] supportedDrivers; - supportedDrivers = new String[]{"org.postgresql.Driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "oracle.jdbc.driver.OracleDriver", "com.amazon.redshift.jdbc.Driver", "com.cloudera.impala.jdbc.Driver", "net.starschema.clouddb.jdbc.BQDriver", "org.netezza.Driver", "com.simba.googlebigquery.jdbc42.Driver", "org.apache.hive.jdbc.HiveDriver", "com.simba.spark.jdbc.Driver", "net.snowflake.client.jdbc.SnowflakeDriver", "com.databricks.client.jdbc.Driver"}; + supportedDrivers = new String[]{"org.postgresql.Driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "oracle.jdbc.driver.OracleDriver", "com.amazon.redshift.jdbc.Driver", "com.cloudera.impala.jdbc.Driver", "net.starschema.clouddb.jdbc.BQDriver", "org.netezza.Driver", "com.simba.googlebigquery.jdbc42.Driver", "org.apache.hive.jdbc.HiveDriver", "com.simba.spark.jdbc.Driver", "net.snowflake.client.jdbc.SnowflakeDriver", "com.databricks.client.jdbc.Driver", "com.intersystems.jdbc.IRISDriver"}; for (String driverName : supportedDrivers) { try { Class.forName(driverName); diff --git a/src/main/resources/i18n/messages_en.json b/src/main/resources/i18n/messages_en.json index be9e537c5c..240c56385d 100644 --- a/src/main/resources/i18n/messages_en.json +++ b/src/main/resources/i18n/messages_en.json @@ -2599,7 +2599,8 @@ "sqlserver": "SQL server", "synapse": "Azure Synapse", "snowflake": "Snowflake", - "spark": "Apache Spark" + "spark": "Apache Spark", + "iris": "InterSystems IRIS" }, "title": "Source dialect" }, diff --git a/src/main/resources/i18n/messages_ko.json b/src/main/resources/i18n/messages_ko.json index f968018501..7aca30eb66 100644 --- a/src/main/resources/i18n/messages_ko.json +++ b/src/main/resources/i18n/messages_ko.json @@ -2599,7 +2599,8 @@ "sqlserver": "SQL server", "synapse": "Azure Synapse", "snowflake": "Snowflake", - "spark": "Apache Spark" + "spark": "Apache Spark", + "iris": "InterSystems IRIS" }, "title": "소스 dialect" }, diff --git a/src/main/resources/i18n/messages_ru.json b/src/main/resources/i18n/messages_ru.json index f745819363..8a42c95a25 100644 --- a/src/main/resources/i18n/messages_ru.json +++ b/src/main/resources/i18n/messages_ru.json @@ -2513,7 +2513,8 @@ "hive": "Hive LLAP", "synapse": "Azure Synapse", "snowflake": "Snowflake", - "spark": "Apache Spark" + "spark": "Apache Spark", + "iris": "InterSystems IRIS" } }, "connectionString": { diff --git a/src/main/resources/i18n/messages_zh.json b/src/main/resources/i18n/messages_zh.json index 29fb81294f..25f3ed8e03 100644 --- a/src/main/resources/i18n/messages_zh.json +++ b/src/main/resources/i18n/messages_zh.json @@ -2599,7 +2599,8 @@ "sqlserver": "SQL服务器", "synapse": "Azure Synapse", "snowflake": "Snowflake", - "spark": "Apache Spark" + "spark": "Apache Spark", + "iris": "InterSystems IRIS" }, "title": "源语言" }, diff --git a/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java b/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java index 40fa1b3a70..1faa232675 100644 --- a/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java +++ b/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java @@ -29,6 +29,7 @@ public class DataSourceDTOParserTest { public static final String ORACLE_WO_PWD_CONN_STR = "jdbc:oracle:thin:@myhost:1521:orcl"; public static final String ORACLE_WITH_PWD_CONN_STR = "jdbc:oracle:thin:scott/tiger@myhost:1521:orcl"; public static final String HIVE_CONN_STR = "jdbc:hive2://sandbox-hdp.hortonworks.com:2181/synpuf_531_orc;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2"; + public static final String IRIS_CONN_STR = "jdbc:iris://localhost:1921/USER"; @Test public void parseDTO() { @@ -110,6 +111,12 @@ public void parseDTO() { assertThat(dto.getConnectionString(), is(HIVE_CONN_STR)); assertThat(dto.getUsername(), is(nullValue())); assertThat(dto.getPassword(), is(nullValue())); + + dto = DataSourceDTOParser.parseDTO(getIRISSource()); + assertThat(dto.getType(), is(DBMSType.IRIS)); + assertThat(dto.getConnectionString(), is(IRIS_CONN_STR)); + assertThat(dto.getUsername(), is(nullValue())); + assertThat(dto.getPassword(), is(nullValue())); } private Source getPostgreSQLPasswordSource() { @@ -204,4 +211,11 @@ private Source getHiveSource() { source.setSourceConnection(HIVE_CONN_STR); return source; } + + private Source getIRISSource() { + Source source = new Source(); + source.setSourceDialect("iris"); + source.setSourceConnection(IRIS_CONN_STR); + return source; + } } \ No newline at end of file From dad187e2912e1bf9de677c4c71413ad7bf425bc9 Mon Sep 17 00:00:00 2001 From: Benjamin De Boe Date: Thu, 29 Feb 2024 11:17:47 +0100 Subject: [PATCH 2/8] update default IRIS connection string --- .../java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java b/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java index 1faa232675..54954b3365 100644 --- a/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java +++ b/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java @@ -29,7 +29,7 @@ public class DataSourceDTOParserTest { public static final String ORACLE_WO_PWD_CONN_STR = "jdbc:oracle:thin:@myhost:1521:orcl"; public static final String ORACLE_WITH_PWD_CONN_STR = "jdbc:oracle:thin:scott/tiger@myhost:1521:orcl"; public static final String HIVE_CONN_STR = "jdbc:hive2://sandbox-hdp.hortonworks.com:2181/synpuf_531_orc;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2"; - public static final String IRIS_CONN_STR = "jdbc:iris://localhost:1921/USER"; + public static final String IRIS_CONN_STR = "jdbc:IRIS://localhost:1972/USER"; @Test public void parseDTO() { From 5b3d8d487ed89d986bc29386e4bc6eff76d4ecdd Mon Sep 17 00:00:00 2001 From: Benjamin De Boe Date: Thu, 29 Feb 2024 11:08:20 +0100 Subject: [PATCH 3/8] initial support for InterSystems IRIS --- .../java/org/ohdsi/webapi/DataAccessConfig.java | 2 +- src/main/resources/i18n/messages_en.json | 3 ++- src/main/resources/i18n/messages_ko.json | 3 ++- src/main/resources/i18n/messages_ru.json | 3 ++- src/main/resources/i18n/messages_zh.json | 3 ++- .../ohdsi/webapi/util/DataSourceDTOParserTest.java | 14 ++++++++++++++ 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/ohdsi/webapi/DataAccessConfig.java b/src/main/java/org/ohdsi/webapi/DataAccessConfig.java index 8bc4e438dc..aac8f7a7e0 100644 --- a/src/main/java/org/ohdsi/webapi/DataAccessConfig.java +++ b/src/main/java/org/ohdsi/webapi/DataAccessConfig.java @@ -82,7 +82,7 @@ public DataSource primaryDataSource() { //note autocommit defaults vary across vendors. use provided @Autowired TransactionTemplate String[] supportedDrivers; - supportedDrivers = new String[]{"org.postgresql.Driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "oracle.jdbc.driver.OracleDriver", "com.amazon.redshift.jdbc.Driver", "com.cloudera.impala.jdbc.Driver", "net.starschema.clouddb.jdbc.BQDriver", "org.netezza.Driver", "com.simba.googlebigquery.jdbc42.Driver", "org.apache.hive.jdbc.HiveDriver", "com.simba.spark.jdbc.Driver", "net.snowflake.client.jdbc.SnowflakeDriver", "com.databricks.client.jdbc.Driver"}; + supportedDrivers = new String[]{"org.postgresql.Driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "oracle.jdbc.driver.OracleDriver", "com.amazon.redshift.jdbc.Driver", "com.cloudera.impala.jdbc.Driver", "net.starschema.clouddb.jdbc.BQDriver", "org.netezza.Driver", "com.simba.googlebigquery.jdbc42.Driver", "org.apache.hive.jdbc.HiveDriver", "com.simba.spark.jdbc.Driver", "net.snowflake.client.jdbc.SnowflakeDriver", "com.databricks.client.jdbc.Driver", "com.intersystems.jdbc.IRISDriver"}; for (String driverName : supportedDrivers) { try { Class.forName(driverName); diff --git a/src/main/resources/i18n/messages_en.json b/src/main/resources/i18n/messages_en.json index 5a247d4bb4..6cbc8d9451 100644 --- a/src/main/resources/i18n/messages_en.json +++ b/src/main/resources/i18n/messages_en.json @@ -2595,7 +2595,8 @@ "sqlserver": "SQL server", "synapse": "Azure Synapse", "snowflake": "Snowflake", - "spark": "Apache Spark" + "spark": "Apache Spark", + "iris": "InterSystems IRIS" }, "title": "Source dialect" }, diff --git a/src/main/resources/i18n/messages_ko.json b/src/main/resources/i18n/messages_ko.json index 63fe140849..9a0accb4aa 100644 --- a/src/main/resources/i18n/messages_ko.json +++ b/src/main/resources/i18n/messages_ko.json @@ -2595,7 +2595,8 @@ "sqlserver": "SQL server", "synapse": "Azure Synapse", "snowflake": "Snowflake", - "spark": "Apache Spark" + "spark": "Apache Spark", + "iris": "InterSystems IRIS" }, "title": "소스 dialect" }, diff --git a/src/main/resources/i18n/messages_ru.json b/src/main/resources/i18n/messages_ru.json index 6b576d00e3..46be05d0f1 100644 --- a/src/main/resources/i18n/messages_ru.json +++ b/src/main/resources/i18n/messages_ru.json @@ -2509,7 +2509,8 @@ "hive": "Hive LLAP", "synapse": "Azure Synapse", "snowflake": "Snowflake", - "spark": "Apache Spark" + "spark": "Apache Spark", + "iris": "InterSystems IRIS" } }, "connectionString": { diff --git a/src/main/resources/i18n/messages_zh.json b/src/main/resources/i18n/messages_zh.json index bc0688ba71..4679e34bdb 100644 --- a/src/main/resources/i18n/messages_zh.json +++ b/src/main/resources/i18n/messages_zh.json @@ -2595,7 +2595,8 @@ "sqlserver": "SQL服务器", "synapse": "Azure Synapse", "snowflake": "Snowflake", - "spark": "Apache Spark" + "spark": "Apache Spark", + "iris": "InterSystems IRIS" }, "title": "源语言" }, diff --git a/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java b/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java index 40fa1b3a70..1faa232675 100644 --- a/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java +++ b/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java @@ -29,6 +29,7 @@ public class DataSourceDTOParserTest { public static final String ORACLE_WO_PWD_CONN_STR = "jdbc:oracle:thin:@myhost:1521:orcl"; public static final String ORACLE_WITH_PWD_CONN_STR = "jdbc:oracle:thin:scott/tiger@myhost:1521:orcl"; public static final String HIVE_CONN_STR = "jdbc:hive2://sandbox-hdp.hortonworks.com:2181/synpuf_531_orc;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2"; + public static final String IRIS_CONN_STR = "jdbc:iris://localhost:1921/USER"; @Test public void parseDTO() { @@ -110,6 +111,12 @@ public void parseDTO() { assertThat(dto.getConnectionString(), is(HIVE_CONN_STR)); assertThat(dto.getUsername(), is(nullValue())); assertThat(dto.getPassword(), is(nullValue())); + + dto = DataSourceDTOParser.parseDTO(getIRISSource()); + assertThat(dto.getType(), is(DBMSType.IRIS)); + assertThat(dto.getConnectionString(), is(IRIS_CONN_STR)); + assertThat(dto.getUsername(), is(nullValue())); + assertThat(dto.getPassword(), is(nullValue())); } private Source getPostgreSQLPasswordSource() { @@ -204,4 +211,11 @@ private Source getHiveSource() { source.setSourceConnection(HIVE_CONN_STR); return source; } + + private Source getIRISSource() { + Source source = new Source(); + source.setSourceDialect("iris"); + source.setSourceConnection(IRIS_CONN_STR); + return source; + } } \ No newline at end of file From cb43436718702fe7bdc444a687ec0c4a5c65f41c Mon Sep 17 00:00:00 2001 From: Benjamin De Boe Date: Thu, 29 Feb 2024 11:17:47 +0100 Subject: [PATCH 4/8] update default IRIS connection string --- .../java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java b/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java index 1faa232675..54954b3365 100644 --- a/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java +++ b/src/test/java/org/ohdsi/webapi/util/DataSourceDTOParserTest.java @@ -29,7 +29,7 @@ public class DataSourceDTOParserTest { public static final String ORACLE_WO_PWD_CONN_STR = "jdbc:oracle:thin:@myhost:1521:orcl"; public static final String ORACLE_WITH_PWD_CONN_STR = "jdbc:oracle:thin:scott/tiger@myhost:1521:orcl"; public static final String HIVE_CONN_STR = "jdbc:hive2://sandbox-hdp.hortonworks.com:2181/synpuf_531_orc;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2"; - public static final String IRIS_CONN_STR = "jdbc:iris://localhost:1921/USER"; + public static final String IRIS_CONN_STR = "jdbc:IRIS://localhost:1972/USER"; @Test public void parseDTO() { From 2ebfdf9b9a529d439daf803278caed5501f64fdc Mon Sep 17 00:00:00 2001 From: Benjamin De Boe Date: Tue, 15 Oct 2024 19:28:55 +0200 Subject: [PATCH 5/8] avoid batch updates on InterSystems IRIS --- .../java/org/ohdsi/webapi/util/CancelableJdbcTemplate.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/ohdsi/webapi/util/CancelableJdbcTemplate.java b/src/main/java/org/ohdsi/webapi/util/CancelableJdbcTemplate.java index a7ebb3d39e..f7d85d7e29 100644 --- a/src/main/java/org/ohdsi/webapi/util/CancelableJdbcTemplate.java +++ b/src/main/java/org/ohdsi/webapi/util/CancelableJdbcTemplate.java @@ -156,6 +156,8 @@ private boolean supportsBatchUpdates(Connection connection) throws SQLException // NOTE: // com.cloudera.impala.hivecommon.dataengine.HiveJDBCDataEngine.prepareBatch throws NOT_IMPLEMENTED exception - return JdbcUtils.supportsBatchUpdates(connection) && !connection.getMetaData().getURL().startsWith("jdbc:impala"); + return JdbcUtils.supportsBatchUpdates(connection) + && !connection.getMetaData().getURL().startsWith("jdbc:impala") + && !connection.getMetaData().getURL().startsWith("jdbc:IRIS"); } } From 70602bfec820a4ccdbe77351bd70482ff0914330 Mon Sep 17 00:00:00 2001 From: Benjamin De Boe Date: Wed, 4 Dec 2024 16:59:21 +0100 Subject: [PATCH 6/8] Update SqlRender and Arachne versions for InterSystems IRIS support --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 184483c9e7..ce53f422d8 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 1.11.2 2.14 - 1.16.1 + 1.19.1 3.1.2 4.0.0 2.12.7 @@ -200,7 +200,7 @@ /WebAPI - 1.17.3 + 1.17.4 2.25.1 600000 12 From d59f4cc3516da6d0331ff0b5d258470fa5e975a0 Mon Sep 17 00:00:00 2001 From: Benjamin De Boe Date: Thu, 2 Jan 2025 18:05:41 +0100 Subject: [PATCH 7/8] adding 'webapi-iris' downloading JDBC driver from Maven --- pom.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pom.xml b/pom.xml index eee0183f8d..9dacc890b4 100644 --- a/pom.xml +++ b/pom.xml @@ -1859,6 +1859,20 @@ + + webapi-iris + + true + 3.10.2 + + + + com.intersystems + intersystems-jdbc + ${iris.driver.version} + + + webapi-gis From 6a012141e0f924165d6144a60365f3ede5ec1a27 Mon Sep 17 00:00:00 2001 From: Benjamin De Boe Date: Fri, 3 Jan 2025 08:45:06 +0100 Subject: [PATCH 8/8] add simple README for building with IRIS --- src/main/extras/iris/README.md | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/main/extras/iris/README.md diff --git a/src/main/extras/iris/README.md b/src/main/extras/iris/README.md new file mode 100644 index 0000000000..f59f307144 --- /dev/null +++ b/src/main/extras/iris/README.md @@ -0,0 +1,46 @@ +# Using WebAPI with InterSystems IRIS support + +## Building WebAPI + +To build WebAPI with InterSystems IRIS support, you can simply use the `webapi-iris` profile +when building WebAPI with Maven: + +```Shell +mvn -Pwebapi-postgresql,webapi-iris clean package +``` + +or on Windows PowerShell: +```Shell +mvn "-Pwebapi-postgresql,webapi-iris" clean package +``` + +This will automatically download and package a recent version of the InterSystems IRIS JDBC +driver from Maven Central. + +Alternatively, the JDBC driver for InterSystems IRIS can be found in the `dev/java/lib/1.8/` +subfolder of your IRIS installation, or as a download from InterSystems Cloud Services portal. + + +## Sample configuration + +When configuring Atlas / WebAPI to access CDM on IRIS over a secure connection, your source +registration looks like this: +```SQL +INSERT INTO webapi.source (source_id, source_name, source_key, source_connection, source_dialect, username, password) + VALUES (<#>, 'OHDSI IRIS Database', 'IRIS', 'jdbc:IRIS://.elb.us-west-2.amazonaws.com:443/USER/:::true', + 'iris', '',''); +``` + +For a non-encrypted, local connection, this may look like: +```SQL +INSERT INTO webapi.source (source_id, source_name, source_key, source_connection, source_dialect, username, password) + VALUES (<#>, 'OHDSI IRIS Database', 'IRIS', 'jdbc:IRIS://localhost:1972/USER/', 'iris', '_SYSTEM_','SYS'); +``` + + +## References + +For more information on how to connect to InterSystems IRIS or InterSystems IRIS Cloud SQL, please see: +* [Connecting your applications to Cloud SQL](https://docs.intersystems.com/components/csp/docbook/DocBook.UI.Page.cls?KEY=GDRIVE_cloudsql) +* [Troubleshooting connection issues](https://docs.intersystems.com/services/csp/docbook/DocBook.UI.Page.cls?KEY=ACTS) +* [InterSystems fork for OHDSI Broadsea](https://github.com/isc-krakshith/InterSystems-Broadsea/) \ No newline at end of file