presto-main/src/main/java/io/prestosql/sql/planner/OutputExtractor.java/OutputExtractor/visitTableWriter
class OutputExtractor:        @Override
        public Void visitTableWriter(TableWriterNode node, Void context)
        {
            WriterTarget writerTarget = node.getTarget();

            if (writerTarget instanceof CreateTarget) {
                CreateTarget target = (CreateTarget) writerTarget;
                catalogName = target.getHandle().getCatalogName();
                checkState(schemaTableName == null || schemaTableName.equals(target.getSchemaTableName()),
                        "cannot have more than a single create, insert or delete in a query");
                schemaTableName = target.getSchemaTableName();
            }
            else if (writerTarget instanceof InsertTarget) {
                InsertTarget target = (InsertTarget) writerTarget;
                catalogName = target.getHandle().getCatalogName();
                checkState(schemaTableName == null || schemaTableName.equals(target.getSchemaTableName()),
                        "cannot have more than a single create, insert or delete in a query");
                schemaTableName = target.getSchemaTableName();
            }
            else if (writerTarget instanceof DeleteTarget) {
                DeleteTarget target = (DeleteTarget) writerTarget;
                catalogName = target.getHandle().getCatalogName();
                checkState(schemaTableName == null || schemaTableName.equals(target.getSchemaTableName()),
                        "cannot have more than a single create, insert or delete in a query");
                schemaTableName = target.getSchemaTableName();
            }

            return null;
        }