public Writer writeCreateTableStatement(Writer writer, String tableName,
                                          List<DBAccessor.DBColumnInfo> columns,
                                          List<String> primaryKeyColumns) {
    //TODO validateNames(String tableName, List<DBAccessor.DBColumnInfo> columns)
    //TODO validatePKNames(List<DBAccessor.DBColumnInfo> columns, String... primaryKeyColumns)

    TableDefinition tableDefinition = new TableDefinition();
    tableDefinition.setName(tableName);
    for (DBAccessor.DBColumnInfo columnInfo : columns) {
      //TODO case-sensitive for now
      int length = columnInfo.getLength() != null ? columnInfo.getLength() : 0;

      if (primaryKeyColumns.contains(columnInfo.getName())) {
        tableDefinition.addIdentityField(columnInfo.getName(), columnInfo.getType(), length);
      } else {
        FieldDefinition fieldDefinition = convertToFieldDefinition(columnInfo);
        tableDefinition.addField(fieldDefinition);
      }
    }

    //TODO possibly move code to avoid unnecessary dependencies and allow extension
    tableDefinition.buildCreationWriter(createStubAbstractSessionFromPlatform(databasePlatform), writer);

    return writer;
  }
Write create table statement to writer
TODO default Value of column not supported
ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/GenericDbmsHelper.java