Skip to content

Commit

Permalink
Merge pull request #1795 from cdapio/CDAP-19665-fix
Browse files Browse the repository at this point in the history
[CDAP-19665] Fix PSQL schema generation in FQN
  • Loading branch information
itsankit-google authored Jul 5, 2023
2 parents 94ec33f + 803657c commit 316ea12
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion database-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
<version>2.10.0</version>
<version>2.13.4.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ private static String getPostgresqlSchema(String url) {
*/
String dbSchema;
int offset = 0;
int startIndex = url.indexOf("connectionSchema=");
offset = 17;
int startIndex = url.indexOf("currentSchema=");
offset = 14;
if (startIndex == -1) {
startIndex = url.indexOf("searchpath=");
offset = 11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public void testPostgresqlFQN() throws Exception {
// Testcases consist of Connection URL, Table Name, Expected FQN String
String[][] testCases = {{"jdbc:postgresql://34.35.36.37/test?user=user&password=secret&ssl=true",
"table1", "postgresql://34.35.36.37:5432/test.public.table1"},
{"jdbc:postgresql://localhost/test?connectionSchema=schema",
{"jdbc:postgresql://localhost/test?currentSchema=schema",
"table2", "postgresql://localhost:5432/test.schema.table2"},
{"jdbc:postgresql://localhost/test?searchpath=schema",
"table3", "postgresql://localhost:5432/test.schema.table3"}};
Expand Down
2 changes: 1 addition & 1 deletion http-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
<version>2.10.0</version>
<version>2.13.4.2</version>
</dependency>
</dependencies>

Expand Down
20 changes: 18 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<commons-lang-version>2.6</commons-lang-version>
<commons-lang3-version>3.5</commons-lang3-version>
<commons-collections.version>3.2.2</commons-collections.version>
<cdap.version>6.9.0-SNAPSHOT</cdap.version>
<cdap.version>6.9.1</cdap.version>
<datastax.version>2.0.5</datastax.version>
<dumbster.version>1.6</dumbster.version>
<es.version>1.6.0</es.version>
Expand All @@ -124,7 +124,7 @@
<json.version>20160212</json.version>
<netty.version>4.1.75.Final</netty.version>
<netty-http.version>1.3.0</netty-http.version>
<spark.version>3.1.1</spark.version>
<spark.version>3.3.2</spark.version>
<testSourceLocation>${project.basedir}/src/test/java/</testSourceLocation>
</properties>

Expand Down Expand Up @@ -774,10 +774,26 @@
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
</exclusion>
<!--
We still use hadoop2,
so excluding hadoop3 dependencies from spark
-->
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-runtime</artifactId>
</exclusion>
<exclusion>
<groupId>com.esotericsoftware.reflectasm</groupId>
<artifactId>reflectasm</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion transform-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
<version>2.10.0</version>
<version>2.13.4.2</version>
</dependency>
<dependency>
<groupId>io.cdap.cdap</groupId>
Expand Down

0 comments on commit 316ea12

Please sign in to comment.