public synchronized void createTable(
            ConnectorSession session,
            Table table,
            PrincipalPrivileges principalPrivileges,
            Optional<Path> currentPath,
            boolean ignoreExisting,
            PartitionStatistics statistics)
    {
        setShared();
        // When creating a table, it should never have partition actions. This is just a sanity check.
        checkNoPartitionAction(table.getDatabaseName(), table.getTableName());
        SchemaTableName schemaTableName = new SchemaTableName(table.getDatabaseName(), table.getTableName());
        Action<TableAndMore> oldTableAction = tableActions.get(schemaTableName);
        TableAndMore tableAndMore = new TableAndMore(table, Optional.of(principalPrivileges), currentPath, Optional.empty(), ignoreExisting, statistics, statistics);
        if (oldTableAction == null) {
            HdfsContext context = new HdfsContext(session, table.getDatabaseName(), table.getTableName());
            tableActions.put(schemaTableName, new Action<>(ActionType.ADD, tableAndMore, context));
            return;
        }
        switch (oldTableAction.getType()) {
            case DROP:
                throw new PrestoException(TRANSACTION_CONFLICT, "Dropping and then recreating the same table in a transaction is not supported");
            case ADD:
            case ALTER:
            case INSERT_EXISTING:
                throw new TableAlreadyExistsException(schemaTableName);
            default:
                throw new IllegalStateException("Unknown action type");
        }
    }
public synchronized void createTable ( ConnectorSession session , Table table , PrincipalPrivileges principalPrivileges , Optional < Path > currentPath , boolean ignoreExisting , PartitionStatistics statistics ) { setShared ( ) ; checkNoPartitionAction ( table . getDatabaseName ( ) , table . getTableName ( ) ) ; SchemaTableName schemaTableName = new SchemaTableName ( table . getDatabaseName ( ) , table . getTableName ( ) ) ; Action < TableAndMore > oldTableAction = tableActions . get ( schemaTableName ) ; TableAndMore tableAndMore = new TableAndMore ( table , Optional . of ( principalPrivileges ) , currentPath , Optional . empty ( ) , ignoreExisting , statistics , statistics ) ; if ( oldTableAction == null ) { HdfsContext context = new HdfsContext ( session , table . getDatabaseName ( ) , table . getTableName ( ) ) ; tableActions . put ( schemaTableName , new Action < > ( ActionType . ADD , tableAndMore , context ) ) ; return ; } switch ( oldTableAction . getType ( ) ) { case DROP : throw new PrestoException ( TRANSACTION_CONFLICT , "Dropping and then recreating the same table in a transaction is not supported" ) ; case ADD : case ALTER : case INSERT_EXISTING : throw new TableAlreadyExistsException ( schemaTableName ) ; default : throw new IllegalStateException ( "Unknown action type" ) ; } }
{@code currentLocation} needs to be supplied if a writePath exists for the table.