Skip to content

Commit

Permalink
DB2/DB2as400 glue get table api issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VenkatasivareddyTR authored and AbdulR3hman committed Jan 10, 2025
1 parent 09e8689 commit 95fb6a9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 95fb6a9

Please sign in to comment.