-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
### What changes were proposed in this pull request? In this PR, we introduce the following points: - Remove the catalog-related configuration from `Graviton` server configuration file. - Support setting catalog configuration with a separate config file located in `catalogs` module - Provide catalog-related configurations for a specific engine with an unique prefix. ### Why are the changes needed? Fix: #478 Fix: #196 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? New UTs
- Loading branch information
Showing
19 changed files
with
343 additions
and
118 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
7 changes: 7 additions & 0 deletions
7
catalogs/catalog-hive/src/main/resources/hive-site.xml.template
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,7 @@ | ||
<!-- | ||
~ Copyright 2023 Datastrato. | ||
~ This software is licensed under the Apache License version 2. | ||
--> | ||
<configuration> | ||
</configuration> | ||
|
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,12 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
|
||
## This file holds common properties for hive catalog and metastore, for more, please refer to | ||
## `org.apache.hadoop.hive.conf.HiveConf` | ||
|
||
## If we want to specify Hive catalog-related configuration like 'hive.metastore.client.capability.check', we can do it like this: | ||
## graviton.bypass.hive.metastore.client.capability.check = true, and 'graviton.bypass' is the prefix that | ||
## the configuration will be directly by pass to backend engine, and 'hive.metastore.client.capability.check' is the configuration key. | ||
graviton.bypass.hive.metastore.client.capability.check = false |
37 changes: 37 additions & 0 deletions
37
...og-hive/src/test/java/com/datastrato/graviton/catalog/hive/TestHiveCatalogOperations.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,37 @@ | ||
/* | ||
* Copyright 2023 Datastrato. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
|
||
package com.datastrato.graviton.catalog.hive; | ||
|
||
import static com.datastrato.graviton.catalog.BaseCatalog.CATALOG_BYPASS_PREFIX; | ||
|
||
import com.google.common.collect.Maps; | ||
import java.util.Map; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class TestHiveCatalogOperations { | ||
@Test | ||
void testInitialize() { | ||
Map<String, String> properties = Maps.newHashMap(); | ||
HiveCatalogOperations hiveCatalogOperations = new HiveCatalogOperations(null); | ||
hiveCatalogOperations.initialize(properties); | ||
String v = hiveCatalogOperations.hiveConf.get("mapreduce.job.reduces"); | ||
Assertions.assertEquals("10", v); | ||
|
||
// Test If we can override the value in hive-site.xml | ||
properties.put(CATALOG_BYPASS_PREFIX + "mapreduce.job.reduces", "20"); | ||
hiveCatalogOperations.initialize(properties); | ||
v = hiveCatalogOperations.hiveConf.get("mapreduce.job.reduces"); | ||
Assertions.assertEquals("20", v); | ||
|
||
// Test If user properties can override the value in hive-site.xml | ||
properties.clear(); | ||
properties.put("mapreduce.job.reduces", "30"); | ||
hiveCatalogOperations.initialize(properties); | ||
v = hiveCatalogOperations.hiveConf.get("mapreduce.job.reduces"); | ||
Assertions.assertEquals("30", v); | ||
} | ||
} |
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,16 @@ | ||
<!-- | ||
~ Copyright 2023 Datastrato. | ||
~ This software is licensed under the Apache License version 2. | ||
--> | ||
<configuration> | ||
<property> | ||
<name>hive.metastore.client.capability.check</name> | ||
<value>true</value> | ||
</property> | ||
|
||
<property> | ||
<name>mapreduce.job.reduces</name> | ||
<value>10</value> | ||
</property> | ||
</configuration> | ||
|
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
6 changes: 6 additions & 0 deletions
6
catalogs/catalog-lakehouse-iceberg/src/main/resources/hdfs-site.xml.template
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,6 @@ | ||
<!-- | ||
~ Copyright 2023 Datastrato. | ||
~ This software is licensed under the Apache License version 2. | ||
--> | ||
<configuration> | ||
</configuration> |
7 changes: 7 additions & 0 deletions
7
catalogs/catalog-lakehouse-iceberg/src/main/resources/hive-site.xml.template
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,7 @@ | ||
<!-- | ||
~ Copyright 2023 Datastrato. | ||
~ This software is licensed under the Apache License version 2. | ||
--> | ||
<configuration> | ||
</configuration> | ||
|
8 changes: 8 additions & 0 deletions
8
catalogs/catalog-lakehouse-iceberg/src/main/resources/lakehouse-iceberg.conf
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,8 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
|
||
## This file holds common configurations for Lakehouse-iceberg catalog. The format of the key is | ||
## 'graviton.bypass.{iceberg-inner-config-key}' and `iceberg-inner-config-key` is the | ||
## real key that pass to Lakehouse-iceberg catalog. |
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
Oops, something went wrong.