public Optional getUpdateLayout()

in src/main/java/org/apache/paimon/trino/TrinoMetadata.java [243:262]


    public Optional<ConnectorPartitioningHandle> getUpdateLayout(
            ConnectorSession session, ConnectorTableHandle tableHandle) {
        TrinoTableHandle trinoTableHandle = (TrinoTableHandle) tableHandle;
        Table table = trinoTableHandle.table(catalog);
        if (!(table instanceof FileStoreTable)) {
            throw new IllegalArgumentException(table.getClass() + " is not supported");
        }
        FileStoreTable storeTable = (FileStoreTable) table;
        BucketMode bucketMode = storeTable.bucketMode();
        if (bucketMode != BucketMode.HASH_FIXED) {
            throw new IllegalArgumentException("Unsupported table bucket mode: " + bucketMode);
        }
        try {
            return Optional.of(
                    new TrinoPartitioningHandle(
                            InstantiationUtil.serializeObject(storeTable.schema())));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }