.add(new ColumnMetadata("t_bigint", ColumnType.LONG, 3, false))
.add(new ColumnMetadata("t_double", ColumnType.DOUBLE, 4, false))
.add(new ColumnMetadata("t_boolean", ColumnType.BOOLEAN, 5, false))
.build();
ConnectorTableMetadata tableMetadata = new ConnectorTableMetadata(temporaryCreateTable, columns, tableOwner);
OutputTableHandle outputHandle = metadata.beginCreateTable(tableMetadata);
// write the records
RecordSink sink = recordSinkProvider.getRecordSink(outputHandle);
sink.beginRecord();
sink.appendLong(1);
sink.appendString("hello".getBytes(UTF_8));
sink.appendLong(123);
sink.appendDouble(43.5);
sink.appendBoolean(true);
sink.finishRecord();
sink.beginRecord();
sink.appendLong(2);
sink.appendNull();
sink.appendNull();
sink.appendNull();
sink.appendNull();
sink.finishRecord();
sink.beginRecord();
sink.appendLong(3);
sink.appendString("bye".getBytes(UTF_8));
sink.appendLong(456);
sink.appendDouble(98.1);
sink.appendBoolean(false);
sink.finishRecord();
String fragment = sink.commit();
// commit the table
metadata.commitCreateTable(outputHandle, ImmutableList.of(fragment));
// load the new table
TableHandle tableHandle = getTableHandle(temporaryCreateTable);
List<ColumnHandle> columnHandles = ImmutableList.copyOf(metadata.getColumnHandles(tableHandle).values());
// verify the metadata
tableMetadata = metadata.getTableMetadata(getTableHandle(temporaryCreateTable));
assertEquals(tableMetadata.getOwner(), tableOwner);
Map<String, ColumnMetadata> columnMap = uniqueIndex(tableMetadata.getColumns(), columnNameGetter());
assertPrimitiveField(columnMap, 0, "id", ColumnType.LONG, false);
assertPrimitiveField(columnMap, 1, "t_string", ColumnType.STRING, false);
assertPrimitiveField(columnMap, 2, "t_bigint", ColumnType.LONG, false);
assertPrimitiveField(columnMap, 3, "t_double", ColumnType.DOUBLE, false);