From 300e0472906db98beef3d0b8f9e103178ffbcd14 Mon Sep 17 00:00:00 2001 From: Patrick Dowler Date: Thu, 7 Mar 2024 12:45:58 -0800 Subject: [PATCH 1/3] caom2-tap-server: update dependencies and test code --- .../src/intTest/resources/SyncResultTest-double-math.properties | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 argus/src/intTest/resources/SyncResultTest-double-math.properties diff --git a/argus/src/intTest/resources/SyncResultTest-double-math.properties b/argus/src/intTest/resources/SyncResultTest-double-math.properties new file mode 100644 index 0000000..48bbf3c --- /dev/null +++ b/argus/src/intTest/resources/SyncResultTest-double-math.properties @@ -0,0 +1,2 @@ +LANG=ADQL +QUERY=select top 1 position_bounds_size, 2*position_bounds_size, position_bounds_size/2 from caom2.Plane where position_bounds is not null From ccb5d4184ddd51cf5c8d3e8ad250f9fa5f57740a Mon Sep 17 00:00:00 2001 From: Patrick Dowler Date: Mon, 18 Mar 2024 10:09:28 -0700 Subject: [PATCH 2/3] caom2-tap-server: adapt for cadc-adql refactoring --- caom2-tap-server/build.gradle | 8 ++-- .../tap/caom2/CaomReadAccessConverter.java | 4 +- .../ca/nrc/cadc/tap/impl/CaomAdqlQuery.java | 6 +-- .../nrc/cadc/tap/caom2/AreaFunctionTest.java | 43 ++----------------- .../tap/caom2/CaomRegionConverterTest.java | 3 +- .../caom2/CaomSelectListConverterTest.java | 29 ++++++------- .../cadc/tap/caom2/CentroidFunctionTest.java | 34 ++------------- .../ca/nrc/cadc/tap/caom2/CoordsysTest.java | 43 ++----------------- 8 files changed, 32 insertions(+), 138 deletions(-) diff --git a/caom2-tap-server/build.gradle b/caom2-tap-server/build.gradle index ca37805..4c54572 100644 --- a/caom2-tap-server/build.gradle +++ b/caom2-tap-server/build.gradle @@ -17,7 +17,7 @@ sourceCompatibility = 1.8 group = 'org.opencadc' -version = '1.2.10' +version = '1.2.11' description = 'OpenCADC CAOM2 TAP server library' def git_url = 'https://github.com/opencadc/caom2service' @@ -30,10 +30,10 @@ dependencies { compile 'org.opencadc:cadc-vosi:[1.0.1,2.0)' compile 'org.opencadc:cadc-dali:[1.1,)' compile 'org.opencadc:cadc-dali-pg:[0.2,)' - compile 'org.opencadc:cadc-tap-server:[1.1.23,)' - compile 'org.opencadc:cadc-tap-server-pg:[1.0.3,)' + compile 'org.opencadc:cadc-tap-server:[1.1.24,)' + compile 'org.opencadc:cadc-tap-server-pg:[1.1.0,)' compile 'org.opencadc:cadc-tap-schema:[1.1.6,)' - compile 'org.opencadc:cadc-adql:[1.1.9,)' + compile 'org.opencadc:cadc-adql:[1.1.14,)' compile 'org.opencadc:caom2-artifact-resolvers:[1.2.3,)' compile 'org.opencadc:cadc-gms:[1.0.0,)' diff --git a/caom2-tap-server/src/main/java/ca/nrc/cadc/tap/caom2/CaomReadAccessConverter.java b/caom2-tap-server/src/main/java/ca/nrc/cadc/tap/caom2/CaomReadAccessConverter.java index 2615523..2295f52 100644 --- a/caom2-tap-server/src/main/java/ca/nrc/cadc/tap/caom2/CaomReadAccessConverter.java +++ b/caom2-tap-server/src/main/java/ca/nrc/cadc/tap/caom2/CaomReadAccessConverter.java @@ -75,7 +75,7 @@ import ca.nrc.cadc.tap.parser.navigator.FromItemNavigator; import ca.nrc.cadc.tap.parser.navigator.ReferenceNavigator; import ca.nrc.cadc.tap.parser.navigator.SelectNavigator; -import ca.nrc.cadc.tap.parser.operator.postgresql.TextSearchMatch; +import ca.nrc.cadc.tap.parser.operator.postgresql.PgTextSearchMatch; import java.text.DateFormat; import java.util.ArrayList; import java.util.Date; @@ -277,7 +277,7 @@ static Expression groupAccessControlExpression(Table assetTable, String metaRead sb.append("|"); } sb.deleteCharAt(sb.length() -1); - rtn = new TextSearchMatch(column, sb.toString()); + rtn = new PgTextSearchMatch(column, sb.toString()); } else { diff --git a/caom2-tap-server/src/main/java/ca/nrc/cadc/tap/impl/CaomAdqlQuery.java b/caom2-tap-server/src/main/java/ca/nrc/cadc/tap/impl/CaomAdqlQuery.java index a84fa9c..a602ec2 100644 --- a/caom2-tap-server/src/main/java/ca/nrc/cadc/tap/impl/CaomAdqlQuery.java +++ b/caom2-tap-server/src/main/java/ca/nrc/cadc/tap/impl/CaomAdqlQuery.java @@ -3,7 +3,7 @@ ******************* CANADIAN ASTRONOMY DATA CENTRE ******************* ************** CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES ************** * -* (c) 2023. (c) 2023. +* (c) 2024. (c) 2024. * Government of Canada Gouvernement du Canada * National Research Council Conseil national de recherches * Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6 @@ -69,12 +69,12 @@ package ca.nrc.cadc.tap.impl; -import ca.nrc.cadc.tap.AdqlQuery; import ca.nrc.cadc.tap.caom2.CaomReadAccessConverter; import ca.nrc.cadc.tap.caom2.CaomRegionConverter; import ca.nrc.cadc.tap.caom2.CaomSelectListConverter; import ca.nrc.cadc.tap.caom2.IsDownloadableConverter; import ca.nrc.cadc.tap.parser.BaseExpressionDeParser; +import ca.nrc.cadc.tap.parser.PgAdqlQuery; import ca.nrc.cadc.tap.parser.PgsphereDeParser; import ca.nrc.cadc.tap.parser.converter.ColumnNameConverter; import ca.nrc.cadc.tap.parser.converter.TableNameConverter; @@ -94,7 +94,7 @@ * * @author pdowler */ -public class CaomAdqlQuery extends AdqlQuery +public class CaomAdqlQuery extends PgAdqlQuery { private static Logger log = Logger.getLogger(CaomAdqlQuery.class); diff --git a/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/AreaFunctionTest.java b/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/AreaFunctionTest.java index 8ce8734..a08c1f1 100644 --- a/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/AreaFunctionTest.java +++ b/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/AreaFunctionTest.java @@ -76,19 +76,11 @@ import java.util.List; import org.apache.log4j.Logger; -import org.junit.After; -import org.junit.AfterClass; import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; -import ca.nrc.cadc.tap.AdqlQuery; import ca.nrc.cadc.tap.TapQuery; -import ca.nrc.cadc.tap.parser.extractor.SelectListExtractor; -import ca.nrc.cadc.tap.parser.navigator.FromItemNavigator; -import ca.nrc.cadc.tap.parser.navigator.ReferenceNavigator; -import ca.nrc.cadc.tap.parser.navigator.SelectNavigator; +import ca.nrc.cadc.tap.impl.CaomAdqlQuery; import ca.nrc.cadc.tap.schema.TapSchema; import ca.nrc.cadc.util.Log4jInit; import ca.nrc.cadc.uws.Parameter; @@ -109,40 +101,11 @@ public class AreaFunctionTest private static TapSchema caomTapSchema = TestUtil.loadTapSchema(); - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception - { + static { Log4jInit.setLevel("ca.nrc.cadc.tap.caom", org.apache.log4j.Level.INFO); } - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception - { - } - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception - { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception - { - } - - private class TestQuery extends AdqlQuery + private class TestQuery extends CaomAdqlQuery { protected void init() { diff --git a/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CaomRegionConverterTest.java b/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CaomRegionConverterTest.java index c42a50f..390aab4 100644 --- a/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CaomRegionConverterTest.java +++ b/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CaomRegionConverterTest.java @@ -74,6 +74,7 @@ import ca.nrc.cadc.tap.AdqlQuery; import ca.nrc.cadc.tap.TapQuery; +import ca.nrc.cadc.tap.impl.CaomAdqlQuery; import ca.nrc.cadc.tap.parser.converter.TableNameConverter; import ca.nrc.cadc.tap.parser.converter.TableNameReferenceConverter; import ca.nrc.cadc.tap.parser.navigator.ExpressionNavigator; @@ -112,7 +113,7 @@ public class CaomRegionConverterTest { Log4jInit.setLevel("ca.nrc.cadc.tap.caom2", Level.INFO); } - private class TestQuery extends AdqlQuery { + private class TestQuery extends CaomAdqlQuery { protected void init() { //super.init(); diff --git a/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CaomSelectListConverterTest.java b/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CaomSelectListConverterTest.java index 1b9e9b3..cb58ec3 100644 --- a/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CaomSelectListConverterTest.java +++ b/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CaomSelectListConverterTest.java @@ -7,14 +7,10 @@ import java.util.List; import org.apache.log4j.Logger; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; -import ca.nrc.cadc.tap.AdqlQuery; import ca.nrc.cadc.tap.TapQuery; +import ca.nrc.cadc.tap.impl.CaomAdqlQuery; import ca.nrc.cadc.tap.schema.TapSchema; import ca.nrc.cadc.util.Log4jInit; import ca.nrc.cadc.uws.Parameter; @@ -28,8 +24,7 @@ public class CaomSelectListConverterTest { private static final Logger log = Logger.getLogger(CaomSelectListConverterTest.class); - static - { + static { Log4jInit.setLevel("ca.nrc.cadc.tap.caom2", Level.INFO); } @@ -38,6 +33,16 @@ public class CaomSelectListConverterTest public CaomSelectListConverterTest() { } + + static class TestQuery extends CaomAdqlQuery + { + @Override + protected void init() + { + //super.init(); + super.navigatorList.add(new CaomSelectListConverter(caomTapSchema)); + } + } @Test public final void testNotFound() @@ -141,14 +146,4 @@ public final void testAccessURLWithAlias() TestUtil.job.getParameterList().clear(); } } - - static class TestQuery extends AdqlQuery - { - @Override - protected void init() - { - //super.init(); - super.navigatorList.add(new CaomSelectListConverter(caomTapSchema)); - } - } } diff --git a/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CentroidFunctionTest.java b/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CentroidFunctionTest.java index ce07f34..886f37d 100644 --- a/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CentroidFunctionTest.java +++ b/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CentroidFunctionTest.java @@ -85,6 +85,7 @@ import ca.nrc.cadc.tap.AdqlQuery; import ca.nrc.cadc.tap.TapQuery; +import ca.nrc.cadc.tap.impl.CaomAdqlQuery; import ca.nrc.cadc.tap.parser.extractor.SelectListExtractor; import ca.nrc.cadc.tap.parser.navigator.FromItemNavigator; import ca.nrc.cadc.tap.parser.navigator.ReferenceNavigator; @@ -109,40 +110,11 @@ public class CentroidFunctionTest private static TapSchema caomTapSchema = TestUtil.loadTapSchema(); - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception - { + static { Log4jInit.setLevel("ca.nrc.cadc.tap.caom", org.apache.log4j.Level.INFO); } - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception - { - } - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception - { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception - { - } - - private class TestQuery extends AdqlQuery + private class TestQuery extends CaomAdqlQuery { protected void init() { diff --git a/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CoordsysTest.java b/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CoordsysTest.java index d448458..582e8e7 100644 --- a/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CoordsysTest.java +++ b/caom2-tap-server/src/test/java/ca/nrc/cadc/tap/caom2/CoordsysTest.java @@ -76,19 +76,11 @@ import java.util.List; import org.apache.log4j.Logger; -import org.junit.After; -import org.junit.AfterClass; import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; -import ca.nrc.cadc.tap.AdqlQuery; import ca.nrc.cadc.tap.TapQuery; -import ca.nrc.cadc.tap.parser.extractor.SelectListExtractor; -import ca.nrc.cadc.tap.parser.navigator.FromItemNavigator; -import ca.nrc.cadc.tap.parser.navigator.ReferenceNavigator; -import ca.nrc.cadc.tap.parser.navigator.SelectNavigator; +import ca.nrc.cadc.tap.impl.CaomAdqlQuery; import ca.nrc.cadc.tap.schema.TapSchema; import ca.nrc.cadc.util.Log4jInit; import ca.nrc.cadc.uws.Parameter; @@ -109,40 +101,11 @@ public class CoordsysTest private static TapSchema caomTapSchema = TestUtil.loadTapSchema(); - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception - { + static { Log4jInit.setLevel("ca.nrc.cadc.tap.caom", org.apache.log4j.Level.INFO); } - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception - { - } - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception - { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception - { - } - - private class TestQuery extends AdqlQuery + private class TestQuery extends CaomAdqlQuery { protected void init() { From 2e6d312c7a18ae6ab6bcd338768313b38a01adba Mon Sep 17 00:00:00 2001 From: Patrick Dowler Date: Mon, 18 Mar 2024 11:10:55 -0700 Subject: [PATCH 3/3] argus:1.0.7 with upstream library changes includes bug fix to actually limit upload table size --- argus/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/argus/VERSION b/argus/VERSION index 1812417..d176497 100644 --- a/argus/VERSION +++ b/argus/VERSION @@ -1,6 +1,6 @@ ## deployable containers have a semantic and build tag # semantic version tag: major.minor # build version tag: timestamp -VER=1.0.6 +VER=1.0.7 TAGS="${VER} ${VER}-$(date -u +"%Y%m%dT%H%M%S")" unset VER