delta-io/connectors

CREATE_TABLE operation should fail if the table already exists

pprudhvi opened this issue · 1 comments

StructField[] fields = new StructField[1];
fields[0] = new StructField("a", new IntegerType(), false);
DeltaLog log = DeltaLog.forTable(new Configuration(), "sales");
OptimisticTransaction tx = log.startTransaction();
 tx.updateMetadata(Metadata.builder().name("sales").schema(new StructType(fields)).build());
tx.commit(new ArrayList<>(), new Operation(Operation.Name.CREATE_TABLE), "MyApp/1.0.0");

Running above again and again is adding new CREATE_TABLE delta commits instead of failing. If there are multiple CREATE_TABLE transactions for a table (on S3), how can we make sure only one of them succeeds?

This repo has been deprecated and the code is moved under connectors module in https://github.com/delta-io/delta repository. Please create the issue in repository https://github.com/delta-io/delta. See #556 for details.