Skip to content

Commit

Permalink
forbiden write
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Nov 5, 2024
1 parent 4ce761e commit 4ba3d37
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@

package org.apache.paimon.table.object;

import org.apache.paimon.manifest.ManifestCacheFilter;
import org.apache.paimon.schema.TableSchema;
import org.apache.paimon.table.DelegatedFileStoreTable;
import org.apache.paimon.table.FileStoreTable;
import org.apache.paimon.table.sink.BatchWriteBuilder;
import org.apache.paimon.table.sink.StreamWriteBuilder;
import org.apache.paimon.table.sink.TableCommitImpl;
import org.apache.paimon.table.sink.TableWriteImpl;
import org.apache.paimon.types.DataTypes;
import org.apache.paimon.types.RowType;

Expand Down Expand Up @@ -120,6 +123,21 @@ public StreamWriteBuilder newStreamWriteBuilder() {
throw new UnsupportedOperationException("Object table does not support Write.");
}

@Override
public TableWriteImpl<?> newWrite(String commitUser) {
throw new UnsupportedOperationException("Object table does not support Write.");
}

@Override
public TableWriteImpl<?> newWrite(String commitUser, ManifestCacheFilter manifestFilter) {
throw new UnsupportedOperationException("Object table does not support Write.");
}

@Override
public TableCommitImpl newCommit(String commitUser) {
throw new UnsupportedOperationException("Object table does not support Write.");
}

@Override
public String objectLocation() {
return objectLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,11 @@ public void testObjectTableRefresh() throws IOException {
// time travel
assertThat(sql("SELECT name, length FROM T /*+ OPTIONS('scan.snapshot-id' = '1') */"))
.containsExactlyInAnyOrder(Row.of("f0", 5L));

// insert into
assertThatThrownBy(() -> sql("INSERT INTO T SELECT * FROM T"))
.rootCause()
.hasMessageContaining("Object table does not support Write.");
assertThat(sql("SELECT name, length FROM T")).containsExactlyInAnyOrder(Row.of("f1", 5L));
}
}

0 comments on commit 4ba3d37

Please sign in to comment.