Ejemplo n.º 1
0
def query_materialize(c: Composition, ) -> int:
    with c.sql_cursor() as cursor:
        try:
            cursor.execute("SELECT * FROM load_test_count")
            row = cursor.fetchone()
            if row is None or len(row) != 1 or row[0] is None:
                return 0
            return int(row[0])
        except InterfaceError as e:
            print(f"C> error while querying materialized: {e}")
            return 0
Ejemplo n.º 2
0
def query_materialize(c: Composition, ) -> int:
    with c.sql_cursor() as cursor:
        try:
            cursor.execute("SELECT * FROM load_test_materialization_frontier")
            row = cursor.fetchone()
            if row is None or len(row) != 1 or row[0] is None:
                return 0
            timestamp = int(row[0])
            if timestamp == 0:
                return 0
            cursor.execute(f"SELECT * FROM records_ingested AS OF {timestamp}")
            row = cursor.fetchone()
            if row is None or len(row) != 1 or row[0] is None:
                return 0
            return int(row[0])
        except InterfaceError as e:
            print(f"C> error while querying materialized: {e}")
            return 0