Skip to content

Commit

Permalink
rename config
Browse files Browse the repository at this point in the history
  • Loading branch information
YannByron committed Mar 8, 2024
1 parent c93c854 commit cf8942b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@
<td>If true, allow to merge data types if the two types meet the rules for explicit casting.</td>
</tr>
<tr>
<td><h5>catalog.inner-session-catalog</h5></td>
<td><h5>catalog.create-underlying-session-catalog</h5></td>
<td style="word-wrap: break-word;">false</td>
<td>Boolean</td>
<td>If true, create and use an inner session catalog instead of default session catalog when use SparkGenericCatalog.</td>
<td>If true, create and use an underlying session catalog instead of default session catalog when use SparkGenericCatalog.</td>
</tr>
</tbody>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
/** Options for spark connector. */
public class SparkConnectorOptions {

public static final ConfigOption<Boolean> INNER_SESSION_CATALOG =
key("catalog.inner-session-catalog")
public static final ConfigOption<Boolean> CREATE_UNDERLYING_SESSION_CATALOG =
key("catalog.create-underlying-session-catalog")
.booleanType()
.defaultValue(false)
.withDescription(
"If true, create and use an inner session catalog instead of default session catalog when use SparkGenericCatalog.");
"If true, create and use an underlying session catalog instead of default session catalog when use SparkGenericCatalog.");
public static final ConfigOption<Boolean> MERGE_SCHEMA =
key("write.merge-schema")
.booleanType()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public class SparkGenericCatalog extends SparkBaseCatalog implements CatalogExte

private SparkCatalog sparkCatalog = null;

private boolean enableInnerSessionCatalog = false;
private boolean underlyingSessionCatalogEnabled = false;

private CatalogPlugin sessionCatalog = null;

Expand Down Expand Up @@ -251,8 +251,8 @@ public final void initialize(String name, CaseInsensitiveStringMap options) {
autoFillConfigurations(options, sessionState.conf(), hadoopConf);
sparkCatalog.initialize(name, newOptions);

if (options.getBoolean(SparkConnectorOptions.INNER_SESSION_CATALOG.key(), false)) {
this.enableInnerSessionCatalog = true;
if (options.getBoolean(SparkConnectorOptions.CREATE_UNDERLYING_SESSION_CATALOG.key(), false)) {
this.underlyingSessionCatalogEnabled = false;
for (Map.Entry<String, String> entry : options.entrySet()) {
sparkConf.set("spark.hadoop." + entry.getKey(), entry.getValue());
hadoopConf.set(entry.getKey(), entry.getValue());
Expand Down Expand Up @@ -298,7 +298,7 @@ private void fillCommonConfigurations(Map<String, String> options, SQLConf sqlCo
@Override
@SuppressWarnings("unchecked")
public void setDelegateCatalog(CatalogPlugin delegate) {
if (!enableInnerSessionCatalog) {
if (!underlyingSessionCatalogEnabled) {
this.sessionCatalog = delegate;
}
}
Expand Down

0 comments on commit cf8942b

Please sign in to comment.