Example #1
0
def impl(context, tablename, schemaname):
    if not check_schema_exists(context, schemaname, context.dbname):
        raise Exception("Schema %s does not exist in database %s" % (schemaname, context.dbname))
    drop_table_if_exists(context, '.'.join([schemaname, tablename]), context.dbname)
    dbconn.execSQL(context.conn, CREATE_MULTI_PARTITION_TABLE_SQL % (schemaname, tablename))
    context.conn.commit()
    check_table_exists(context, context.dbname, '.'.join([schemaname, tablename]), table_type = 'ao')
Example #2
0
def impl(context, storage_type, tablename, col_name_list, col_type_list, schemaname):
    schemaname_no_quote = schemaname
    if '"' in schemaname:
        schemaname_no_quote = schemaname[1:-1]
    if not check_schema_exists(context, schemaname_no_quote, context.dbname):
        raise Exception("Schema %s does not exist in database %s" % (schemaname_no_quote, context.dbname))
    drop_table_if_exists(context, '.'.join([schemaname, tablename]), context.dbname)
    create_table_with_column_list(context.conn, storage_type, schemaname, tablename, col_name_list, col_type_list)
    check_table_exists(context, context.dbname, '.'.join([schemaname, tablename]), table_type = storage_type)
Example #3
0
def impl(context, tablename, schemaname):
    if not check_schema_exists(context, schemaname, context.dbname):
        raise Exception("Schema %s does not exist in database %s" %
                        (schemaname, context.dbname))
    drop_table_if_exists(context, '.'.join([schemaname, tablename]),
                         context.dbname)
    dbconn.execSQL(context.conn,
                   CREATE_MULTI_PARTITION_TABLE_SQL % (schemaname, tablename))
    context.conn.commit()
    check_table_exists(context,
                       context.dbname,
                       '.'.join([schemaname, tablename]),
                       table_type='ao')
Example #4
0
def impl(context, storage_type, tablename, col_name_list, col_type_list,
         schemaname):
    if not check_schema_exists(context, schemaname, context.dbname):
        raise Exception("Schema %s does not exist in database %s" %
                        (schemaname, context.dbname))
    drop_table_if_exists(context, '.'.join([schemaname, tablename]),
                         context.dbname)
    create_table_with_column_list(context.conn, storage_type, schemaname,
                                  tablename, col_name_list, col_type_list)
    check_table_exists(context,
                       context.dbname,
                       '.'.join([schemaname, tablename]),
                       table_type=storage_type)
Example #5
0
def impl(context, filename, table_type, tablename, dbname):
    if not check_table_exists(context, dbname=dbname, table_name=tablename, table_type=table_type):
        raise Exception("Table '%s' does not exist when it should" % tablename)
    validate_restore_data_in_file(context, tablename, dbname, filename)
Example #6
0
def impl(context, filename, table_type, tablename, dbname):
    if not check_table_exists(
            context, dbname=dbname, table_name=tablename,
            table_type=table_type):
        raise Exception("Table '%s' does not exist when it should" % tablename)
    validate_restore_data_in_file(context, tablename, dbname, filename)