-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reference view information to TableInfo
- Loading branch information
1 parent
f1d680c
commit 467dd8b
Showing
16 changed files
with
835 additions
and
58 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
54 changes: 54 additions & 0 deletions
54
core/trino-spi/src/main/java/io/trino/spi/eventlistener/BaseViewReferenceInfo.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,54 @@ | ||
/* | ||
* 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 io.trino.spi.eventlistener; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
/** | ||
* This class is JSON serializable for convenience and serialization compatibility is not guaranteed across versions. | ||
*/ | ||
public abstract class BaseViewReferenceInfo | ||
implements TableReferenceInfo | ||
{ | ||
private final String catalogName; | ||
private final String schemaName; | ||
private final String viewName; | ||
|
||
protected BaseViewReferenceInfo(String catalogName, String schemaName, String viewName) | ||
{ | ||
this.catalogName = requireNonNull(catalogName, "catalogName is null"); | ||
this.schemaName = requireNonNull(schemaName, "schemaName is null"); | ||
this.viewName = requireNonNull(viewName, "viewName is null"); | ||
} | ||
|
||
@JsonProperty | ||
public String getCatalogName() | ||
{ | ||
return catalogName; | ||
} | ||
|
||
@JsonProperty | ||
public String getSchemaName() | ||
{ | ||
return schemaName; | ||
} | ||
|
||
@JsonProperty | ||
public String getViewName() | ||
{ | ||
return viewName; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
core/trino-spi/src/main/java/io/trino/spi/eventlistener/ColumnMaskReferenceInfo.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,39 @@ | ||
/* | ||
* 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 io.trino.spi.eventlistener; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* This class is JSON serializable for convenience and serialization compatibility is not guaranteed across versions. | ||
*/ | ||
public class ColumnMaskReferenceInfo | ||
extends FilterMaskReferenceInfo | ||
{ | ||
private final String columnName; | ||
|
||
@JsonCreator | ||
public ColumnMaskReferenceInfo(String maskExpression, String targetCatalogName, String targetSchemaName, String targetTableName, String targetColumnName) | ||
{ | ||
super(maskExpression, targetCatalogName, targetSchemaName, targetTableName); | ||
this.columnName = targetColumnName; | ||
} | ||
|
||
@JsonProperty | ||
public String getTargetColumnName() | ||
{ | ||
return columnName; | ||
} | ||
} |
Oops, something went wrong.