Example #1
0
def framework_dup_test(dbname):
    dw_rep = make_dw_rep(dbname)
    dup = NoDuplicateRowPredicate('ft1', ['key1', 'key2'])
    case = Case(dw_rep, [dup])
    start = time.monotonic()  # the instantiations take almost no time
    case.run()
    end = time.monotonic()
    elapsed = end - start
    print('{}{}'.format(round(elapsed, 3), 's'))
Example #2
0
def framework_row_count_test(path):
    dw_rep = make_dw_rep(path)
    count = RowCountPredicate('ft1', 1000000)
    case = Case(dw_rep, [count])
    start = time.monotonic()  # the instantiations take almost no time
    case.run()                # but we may as well measure the time for
    end = time.monotonic()    # executing the case
    elapsed = end - start
    print('{}{}'.format(round(elapsed, 3), 's'))
Example #3
0
def framework_not_null_test(dbname):
    dw_rep = make_dw_rep(dbname)
    not_null = ColumnNotNullPredicate('ft1', ['key1', 'key2'])
    case = Case(dw_rep, [not_null])
    start = time.monotonic()  # the instantiations take almost no time
    case.run()
    end = time.monotonic()
    elapsed = end - start
    print('{}{}'.format(round(elapsed, 3), 's'))
Example #4
0
def framework_fd_test(path):
    dw_rep = make_dw_rep(path)
    print("Running Case")
    fd = FunctionalDependencyPredicate(["ft1"], ((("key1",), ("key2",)),))
    case = Case(dw_rep, [fd])
    start = time.monotonic()
    case.run()
    end = time.monotonic()
    elapsed = end - start
    print("Done: {}{}".format(round(elapsed, 3), "s"))
Example #5
0
def framework_compare_test(path, number):
    dw_rep = make_dw_rep(path)
    expected_rows = []
    counter = 0
    print('Generating expected table')
    start = time.monotonic()
    for i in range(1, number + 1):
        for j in range(1, number + 1):
            counter += 10
            expected_rows.append({'key1': i, 'key2': j, 'measure': counter})

    end = time.monotonic()
    elapsed = end - start
    print('Done: {}{}'.format(round(elapsed, 3), 's'))
    print('Running Case')
    compare = CompareTablePredicate('ft1', expected_rows)
    case = Case(dw_rep, [compare])
    start = time.monotonic()
    case.run()
    end = time.monotonic()
    elapsed = end - start
    print('Done: {}{}'.format(round(elapsed, 3), 's'))