JingsongLi opened a new pull request, #4340:
URL: https://github.com/apache/paimon/pull/4340
<!-- Please specify the module before the PR name: [core] ... or [flink] ...
-->
### Purpose
<!-- Linking this pull request to the issue -->
This PR aims to support View in Catalog, our metastore behind us, such as
Hive metastore, supports views, but our catalog has not done this conversion
well. This PR aims to support the definition of views and bridge with
HiveCatalog.
#### Definition of view
```
/** Interface for view definition. */
public interface View {
/** A name to identify this view. */
String name();
/** Full name (including database) to identify this view. */
String fullName();
/** Returns the row type of this view. */
RowType rowType();
/** Returns the view representation. */
String query();
/** Optional comment of this view. */
Optional<String> comment();
/** Options of this view. */
Map<String, String> options();
/** Copy this view with adding dynamic options. */
View copy(Map<String, String> dynamicOptions);
}
```
#### Catalog interfaces
```
/**
* Return a {@link View} identified by the given {@link Identifier}.
*
* @param identifier Path of the view
* @return The requested view
* @throws ViewNotExistException if the target does not exist
*/
default View getView(Identifier identifier) throws ViewNotExistException
{
throw new ViewNotExistException(identifier);
}
/**
* Drop a view.
*
* @param identifier Path of the view to be dropped
* @param ignoreIfNotExists Flag to specify behavior when the view does
not exist: if set to
* false, throw an exception, if set to true, do nothing.
* @throws ViewNotExistException if the view does not exist
*/
default void dropView(Identifier identifier, boolean ignoreIfNotExists)
throws ViewNotExistException {
throw new UnsupportedOperationException();
}
/**
* Create a new view.
*
* @param identifier path of the view to be created
* @param view the view definition
* @param ignoreIfExists flag to specify behavior when a view already
exists at the given path:
* if set to false, it throws a ViewAlreadyExistException, if set to
true, do nothing.
* @throws ViewAlreadyExistException if view already exists and
ignoreIfExists is false
* @throws DatabaseNotExistException if the database in identifier
doesn't exist
*/
default void createView(Identifier identifier, View view, boolean
ignoreIfExists)
throws ViewAlreadyExistException, DatabaseNotExistException {
throw new UnsupportedOperationException();
}
```
Implemented these methods in `HiveCatalog`.
#### Flink Integration
Integrate to Flink Catalog.
<!-- What is the purpose of the change -->
### Tests
<!-- List UT and IT cases to verify this change -->
### API and Format
<!-- Does this change affect API or storage format -->
### Documentation
<!-- Does this change introduce a new feature -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]