Ejemplo n.º 1
0
__author__ = 'Alexander'
import sys
sys.path.append('../')
from framework.case import Case
from framework.dw_populator import DWPopulator
from framework.predicates import ColumnNotNullPredicate
from framework.predicates import CompareTablePredicate
from framework.predicates import RowCountPredicate
import  sqlite3
import os

SALES_DB_NAME = './2sales.db'
DW_NAME = "C:/Users/Alexander/Documents/GitHub/P6/code/examples/pygrametl" \
"_examples/example_1/dw.db"
CSV_NAME = './2region.csv'
path = "C:/Users/Alexander/Documents/GitHub/P6/code/examples/pygrametl" \
"_examples/example_1/example_1.py"

s1 = sqlite3.connect(SALES_DB_NAME)
s2 = open(CSV_NAME, "r")
n = RowCountPredicate('bookdim', 1)


dwp = DWPopulator(path, sqlite3, True, database=DW_NAME)
rep = dwp.run()

c = Case(rep, [n])
c.run()
Ejemplo n.º 2
0
e_fdp_test = FunctionalDependencyPredicate(table_name=['authordim', 'countrydim'],
                                         alpha='country',
                                         beta='city')

rip_test = ReferentialIntegrityPredicate()





pred_list = [ndrp_test, e_ndrp_test, fdp_test, e_fdp_test, rip_test]

dw_path = './dw.db'
pygrametl_program_path = './etl.py'
dwp = DWPopulator(pygrametl_program_path,
                  pep249_module=sqlite3,
                  program_is_path=True,
                  database=dw_path) # Arg til sqlite3

dw_rep = dwp.run()

# Checking how long it took.
time_before_test = time_passed(start)

case = Case(dw_rep, pred_list)

case.run()


time_after_test = time_passed(start)

# Checking how long it took.