diqiu50 commented on code in PR #10757:
URL: https://github.com/apache/gravitino/pull/10757#discussion_r3232525766
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/GravitinoMetadata.java:
##########
@@ -230,12 +230,19 @@ public ConnectorOutputTableHandle beginCreateTable(
ConnectorTableMetadata tableMetadata,
Optional<ConnectorTableLayout> layout,
RetryMode retryMode,
- boolean noExistingData) {
- // First, create the table in the Gravitino catalog
+ boolean replace) {
+ SchemaTableName tableName = tableMetadata.getTable();
+
+ // CREATE OR REPLACE TABLE AS SELECT: drop the existing table first if
present.
+ if (replace
+ && catalogConnectorMetadata.tableExists(
+ tableName.getSchemaName(), tableName.getTableName())) {
+ catalogConnectorMetadata.dropTable(tableName);
Review Comment:
That’s fine.
Please add comments in the code.
For the documentation, we can include some notes in the CTAS section.
--
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]