prestodb/presto · error · UnsupportedOperationException

Rename operation is not supported yet

Error message

Rename operation is not supported yet

What it means

The LarkSheetsSchemaStore interface provides a default rename() that unconditionally throws UnsupportedOperationException. Rename is declared but not implemented, so any caller invoking rename on this store always fails.

Source

Thrown at presto-lark-sheets/src/main/java/com/facebook/presto/lark/sheets/api/LarkSheetsSchemaStore.java:28

 * 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.facebook.presto.lark.sheets.api;

import java.util.Optional;

public interface LarkSheetsSchemaStore
{
    Optional<LarkSheetsSchema> get(String name);

    void insert(LarkSheetsSchema schema);

    void delete(String schemaName);

    default void rename(String source, String target)
    {
        throw new UnsupportedOperationException("Rename operation is not supported yet");
    }

    Iterable<LarkSheetsSchema> listForUser(String user);
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Do not use rename with this connector; drop and re-insert the schema/table under the new name instead.
  2. Override rename(source, target) in a custom store implementation to implement the copy-then-delete logic.
  3. Guard user-facing tooling to hide/disable rename operations for lark-sheets catalogs.

Example fix

// before
store.rename("old", "new");

// after
LarkSheetsSchema schema = /* fetch by source */;
store.insert(schema.withName("new"));
store.delete("old");
Defensive patterns

Strategy: fallback

Validate before calling

// detect support before calling
boolean renameSupported = !(store instanceof LarkSheetsSchemaStore) || hasRenameOverride(store);
// simpler: feature-flag rename in tooling for lark-sheets catalogs

Type guard

boolean supportsRename(Object store) { try { return java.lang.reflect.Method.class.cast(store.getClass().getMethod("rename", String.class, String.class)).getDeclaringClass() != LarkSheetsSchemaStore.class; } catch (NoSuchMethodException e) { return false; } }

Try / catch

try { store.rename(source, target); } catch (UnsupportedOperationException e) { copyThenDelete(store, source, target); }

Prevention

When it happens

Trigger: Calling rename(source, target) on LarkSheetsSchemaStore (or any store that doesn't override the default) — e.g. ALTER TABLE/SCHEMA RENAME flowing through the connector.

Common situations: Running ALTER TABLE ... RENAME TO against a lark-sheets table; tooling that renames schemas as part of migration.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/af7416a63b279bdf. Report an issue: GitHub.