-
Notifications
You must be signed in to change notification settings - Fork 967
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Modularization: Schema overrides via string and file (#1840)
* Schema overrides via String and file * Apply spotless * Fix UTs * Add UTs and remove redundant toString() * Spotless * Add regex for string overrides * Apply spotless * Fix regex * Add NoopSchemaOverridesParser * Address comments * Address comments * Swtich PCRE regex from alnum to graph
- Loading branch information
1 parent
e122b9e
commit 3b15a14
Showing
16 changed files
with
960 additions
and
15 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
38 changes: 38 additions & 0 deletions
38
...n/java/com/google/cloud/teleport/v2/spanner/migrations/schema/ISchemaOverridesParser.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,38 @@ | ||
/* | ||
* Copyright (C) 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package com.google.cloud.teleport.v2.spanner.migrations.schema; | ||
|
||
public interface ISchemaOverridesParser { | ||
|
||
/** | ||
* Gets the spanner table name given the source table name, or source table name if no override is | ||
* configured. | ||
* | ||
* @param sourceTableName The source table name | ||
* @return The overridden spanner table name | ||
*/ | ||
String getTableOverride(String sourceTableName); | ||
|
||
/** | ||
* Gets the spanner column name given the source table name, or the source column name if override | ||
* is configured. | ||
* | ||
* @param sourceTableName the source table name for which column name is overridden | ||
* @param sourceColumnName the source column name being overridden | ||
* @return A pair of spannerTableName and spannerColumnName | ||
*/ | ||
String getColumnOverride(String sourceTableName, String sourceColumnName); | ||
} |
Oops, something went wrong.