forked from apache/gravitino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[apache#832]feat(jdbc-postgresql): Support for postgresql catalog in …
…Gravitino (apache#900) ### What changes were proposed in this pull request? We need to support PostgreSql as the storage protocol for the catalog in Gravetino ### Why are the changes needed? Fix: apache#832 ### Does this PR introduce any user-facing change? NO ### How was this patch tested? UT --------- Co-authored-by: Clearvive <[email protected]>
- Loading branch information
Showing
34 changed files
with
1,603 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2023 Datastrato. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
description = "catalog-jdbc-postgresql" | ||
|
||
plugins { | ||
`maven-publish` | ||
id("java") | ||
id("idea") | ||
} | ||
|
||
dependencies { | ||
implementation(project(":common")) | ||
implementation(project(":core")) | ||
implementation(project(":api")) | ||
implementation(project(":catalogs:catalog-jdbc-common")) | ||
implementation(libs.guava) | ||
implementation(libs.bundles.log4j) | ||
implementation(libs.commons.lang3) | ||
implementation(libs.commons.collections4) | ||
implementation(libs.jsqlparser) | ||
} | ||
|
||
tasks { | ||
val copyDepends by registering(Copy::class) { | ||
from(configurations.runtimeClasspath) | ||
into("build/libs") | ||
} | ||
val copyCatalogLibs by registering(Copy::class) { | ||
dependsOn(copyDepends, "build") | ||
from("build/libs") | ||
into("$rootDir/distribution/package/catalogs/jdbc-postgresql/libs") | ||
} | ||
|
||
val copyCatalogConfig by registering(Copy::class) { | ||
from("src/main/resources") | ||
into("$rootDir/distribution/package/catalogs/jdbc-postgresql/conf") | ||
|
||
include("jdbc-postgresql.conf") | ||
|
||
exclude { details -> | ||
details.file.isDirectory() | ||
} | ||
} | ||
|
||
val copyLibAndConfig by registering(Copy::class) { | ||
dependsOn(copyCatalogLibs, copyCatalogConfig) | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...stgresql/src/main/java/com/datastrato/gravitino/catalog/postgresql/PostgreSqlCatalog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2023 Datastrato. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
package com.datastrato.gravitino.catalog.postgresql; | ||
|
||
import com.datastrato.gravitino.catalog.jdbc.JdbcCatalog; | ||
import com.datastrato.gravitino.catalog.jdbc.converter.JdbcExceptionConverter; | ||
import com.datastrato.gravitino.catalog.jdbc.converter.JdbcTypeConverter; | ||
import com.datastrato.gravitino.catalog.jdbc.operation.JdbcDatabaseOperations; | ||
import com.datastrato.gravitino.catalog.jdbc.operation.JdbcTableOperations; | ||
import com.datastrato.gravitino.catalog.postgresql.converter.PostgreSqlExceptionConverter; | ||
import com.datastrato.gravitino.catalog.postgresql.converter.PostgreSqlTypeConverter; | ||
import com.datastrato.gravitino.catalog.postgresql.operation.PostgreSqlSchemaOperations; | ||
import com.datastrato.gravitino.catalog.postgresql.operation.PostgreSqlTableOperations; | ||
|
||
public class PostgreSqlCatalog extends JdbcCatalog { | ||
|
||
@Override | ||
public String shortName() { | ||
return "jdbc-postgresql"; | ||
} | ||
|
||
@Override | ||
protected JdbcExceptionConverter createExceptionConverter() { | ||
return new PostgreSqlExceptionConverter(); | ||
} | ||
|
||
@Override | ||
protected JdbcTypeConverter createJdbcTypeConverter() { | ||
return new PostgreSqlTypeConverter(); | ||
} | ||
|
||
@Override | ||
protected JdbcDatabaseOperations createJdbcDatabaseOperations() { | ||
return new PostgreSqlSchemaOperations(); | ||
} | ||
|
||
@Override | ||
protected JdbcTableOperations createJdbcTableOperations() { | ||
return new PostgreSqlTableOperations(); | ||
} | ||
} |
Oops, something went wrong.