diff --git a/athena-db2-as400/src/main/java/com/amazonaws/athena/connectors/db2as400/Db2As400MetadataHandler.java b/athena-db2-as400/src/main/java/com/amazonaws/athena/connectors/db2as400/Db2As400MetadataHandler.java index a589bbc33d..0f453f070d 100644 --- a/athena-db2-as400/src/main/java/com/amazonaws/athena/connectors/db2as400/Db2As400MetadataHandler.java +++ b/athena-db2-as400/src/main/java/com/amazonaws/athena/connectors/db2as400/Db2As400MetadataHandler.java @@ -77,7 +77,7 @@ public class Db2As400MetadataHandler extends JdbcMetadataHandler { private static final Logger LOGGER = LoggerFactory.getLogger(Db2As400MetadataHandler.class); - static final String PARTITION_NUMBER = "PARTITION_NUMBER"; + static final String PARTITION_NUMBER = "PARTITION_NUMBER".toLowerCase(); static final String PARTITIONING_COLUMN = "PARTITIONING_COLUMN"; /** * DB2 has max number of partition 32,000 diff --git a/athena-db2-as400/src/test/java/com/amazonaws/athena/connectors/db2as400/Db2As400MetadataHandlerTest.java b/athena-db2-as400/src/test/java/com/amazonaws/athena/connectors/db2as400/Db2As400MetadataHandlerTest.java index ce35bab8e8..57130318d4 100644 --- a/athena-db2-as400/src/test/java/com/amazonaws/athena/connectors/db2as400/Db2As400MetadataHandlerTest.java +++ b/athena-db2-as400/src/test/java/com/amazonaws/athena/connectors/db2as400/Db2As400MetadataHandlerTest.java @@ -73,7 +73,7 @@ public class Db2As400MetadataHandlerTest extends TestBase { private static final Logger logger = LoggerFactory.getLogger(Db2As400MetadataHandlerTest.class); - private static final Schema PARTITION_SCHEMA = SchemaBuilder.newBuilder().addField("PARTITION_NUMBER", org.apache.arrow.vector.types.Types.MinorType.VARCHAR.getType()).build(); + private static final Schema PARTITION_SCHEMA = SchemaBuilder.newBuilder().addField("partition_number", org.apache.arrow.vector.types.Types.MinorType.VARCHAR.getType()).build(); private DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog", Db2As400Constants.NAME, "db2as400://jdbc:as400://testhost;user=dummy;password=dummy;"); private Db2As400MetadataHandler db2As400MetadataHandler; diff --git a/athena-db2-as400/src/test/java/com/amazonaws/athena/connectors/db2as400/Db2As400QueryStringBuilderTest.java b/athena-db2-as400/src/test/java/com/amazonaws/athena/connectors/db2as400/Db2As400QueryStringBuilderTest.java index ec8132341e..b6a4d35874 100644 --- a/athena-db2-as400/src/test/java/com/amazonaws/athena/connectors/db2as400/Db2As400QueryStringBuilderTest.java +++ b/athena-db2-as400/src/test/java/com/amazonaws/athena/connectors/db2as400/Db2As400QueryStringBuilderTest.java @@ -45,7 +45,7 @@ public void testGetPartitionWhereClauses() { Db2As400QueryStringBuilder builder = new Db2As400QueryStringBuilder("'"); Split split = Mockito.mock(Split.class); - Mockito.when(split.getProperty(Mockito.eq("PARTITION_NUMBER"))).thenReturn("0"); + Mockito.when(split.getProperty(Mockito.eq("partition_number"))).thenReturn("0"); Mockito.when(split.getProperty(Mockito.eq("PARTITIONING_COLUMN"))).thenReturn("PC"); Assert.assertEquals(Arrays.asList(" DATAPARTITIONNUM(PC) = 0"), builder.getPartitionWhereClauses(split)); } diff --git a/athena-db2/src/main/java/com/amazonaws/athena/connectors/db2/Db2MetadataHandler.java b/athena-db2/src/main/java/com/amazonaws/athena/connectors/db2/Db2MetadataHandler.java index 965197ff0a..4982430f70 100644 --- a/athena-db2/src/main/java/com/amazonaws/athena/connectors/db2/Db2MetadataHandler.java +++ b/athena-db2/src/main/java/com/amazonaws/athena/connectors/db2/Db2MetadataHandler.java @@ -86,7 +86,7 @@ public class Db2MetadataHandler extends JdbcMetadataHandler { private static final Logger LOGGER = LoggerFactory.getLogger(Db2MetadataHandler.class); - static final String PARTITION_NUMBER = "PARTITION_NUMBER"; + static final String PARTITION_NUMBER = "PARTITION_NUMBER".toLowerCase(); static final String PARTITIONING_COLUMN = "PARTITIONING_COLUMN"; /** * DB2 has max number of partition 32,000 diff --git a/athena-db2/src/test/java/com/amazonaws/athena/connectors/db2/Db2MetadataHandlerTest.java b/athena-db2/src/test/java/com/amazonaws/athena/connectors/db2/Db2MetadataHandlerTest.java index 81a1ebb474..5f7b5c23b5 100644 --- a/athena-db2/src/test/java/com/amazonaws/athena/connectors/db2/Db2MetadataHandlerTest.java +++ b/athena-db2/src/test/java/com/amazonaws/athena/connectors/db2/Db2MetadataHandlerTest.java @@ -74,7 +74,7 @@ public class Db2MetadataHandlerTest extends TestBase { private static final Logger logger = LoggerFactory.getLogger(Db2MetadataHandlerTest.class); - private static final Schema PARTITION_SCHEMA = SchemaBuilder.newBuilder().addField("PARTITION_NUMBER", org.apache.arrow.vector.types.Types.MinorType.VARCHAR.getType()).build(); + private static final Schema PARTITION_SCHEMA = SchemaBuilder.newBuilder().addField("partition_number", org.apache.arrow.vector.types.Types.MinorType.VARCHAR.getType()).build(); private DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog", Db2Constants.NAME, "dbtwo://jdbc:db2://hostname:50001/dummydatabase:user=dummyuser;password=dummypwd"); private Db2MetadataHandler db2MetadataHandler; diff --git a/athena-db2/src/test/java/com/amazonaws/athena/connectors/db2/Db2QueryStringBuilderTest.java b/athena-db2/src/test/java/com/amazonaws/athena/connectors/db2/Db2QueryStringBuilderTest.java index 859a8415b9..607cfcf17b 100644 --- a/athena-db2/src/test/java/com/amazonaws/athena/connectors/db2/Db2QueryStringBuilderTest.java +++ b/athena-db2/src/test/java/com/amazonaws/athena/connectors/db2/Db2QueryStringBuilderTest.java @@ -47,7 +47,7 @@ public void testGetPartitionWhereClauses() { Db2QueryStringBuilder builder = new Db2QueryStringBuilder(QUOTE_CHARACTER, new Db2FederationExpressionParser(QUOTE_CHARACTER)); Split split = Mockito.mock(Split.class); - Mockito.when(split.getProperty(Mockito.eq("PARTITION_NUMBER"))).thenReturn("0"); + Mockito.when(split.getProperty(Mockito.eq("partition_number"))).thenReturn("0"); Mockito.when(split.getProperty(Mockito.eq("PARTITIONING_COLUMN"))).thenReturn("PC"); Assert.assertEquals(Arrays.asList(" DATAPARTITIONNUM(PC) = 0"), builder.getPartitionWhereClauses(split)); }