Exemple #1
0
def expressions(sources):
    df, x, sql, bc, mongo = sources

    return {
        t: [],
        t['id']: [],
        abs(t['amount']): [],
        t.id.max(): [],
        t.amount.sum(): [],
        t.amount.sum(keepdims=True): [],
        t.amount.count(keepdims=True): [],
        t.amount.nunique(keepdims=True): [mongo],
        t.amount.nunique(): [],
        t.amount.head(): [],
        t.amount + 1: [mongo],
        sin(t.amount): [sql, mongo],  # sqlite doesn't support trig
        exp(t.amount): [sql, mongo],
        t.amount > 50: [mongo],
        t[t.amount > 50]: [],
        t[t.name.str.like('Alic*')]: [],
        t.sort('name'): [bc],
        t.sort('name', ascending=False): [bc],
        t.head(3): [],
        t.name.distinct(): [],
        t[t.amount > 50]['name']: [],  # odd ordering issue
        t.id.map(lambda x: x + 1, schema='int64', name='id'): [sql, mongo],
        t[t.amount > 50]['name']: [],
        by(t.name, total=t.amount.sum()): [],
        by(t.id, count=t.id.count()): [],
        by(t[['id', 'amount']], count=t.id.count()): [],
        by(t[['id', 'amount']], total=(t.amount + 1).sum()): [mongo],
        by(t[['id', 'amount']], n=t.name.nunique()): [mongo, bc],
        by(t.id, count=t.amount.count()): [],
        by(t.id, n=t.id.nunique()): [mongo, bc],
        # by(t, count=t.count()): [],
        # by(t.id, count=t.count()): [],
        t[['amount', 'id']]: [x],  # https://github.com/numpy/numpy/issues/3256
        t[['id', 'amount']]: [x, bc],  # bcolz sorting
        t[0]: [sql, mongo, bc],
        t[::2]: [sql, mongo, bc],
        t.id.utcfromtimestamp: [sql],
        t.distinct().nrows: [],
        t.nelements(axis=0): [],
        t.nelements(axis=None): [],
        t.amount.truncate(200): [sql]
    }
Exemple #2
0
def expressions(sources):
    df, x, sql, bc, mongo = sources

    return {
        t: [],
        t['id']: [],
        abs(t['amount']): [],
        t.id.max(): [],
        t.amount.sum(): [],
        t.amount.sum(keepdims=True): [],
        t.amount.count(keepdims=True): [],
        t.amount.nunique(keepdims=True): [mongo],
        t.amount.nunique(): [],
        t.amount.head(): [],
        t.amount + 1: [mongo],
        sin(t.amount): [sql, mongo], # sqlite doesn't support trig
        exp(t.amount): [sql, mongo],
        t.amount > 50: [mongo],
        t[t.amount > 50]: [],
        t[t.name.str.like('Alic*')]: [],
        t.sort('name'): [bc],
        t.sort('name', ascending=False): [bc],
        t.head(3): [],
        t.name.distinct(): [],
        t[t.amount > 50]['name']: [], # odd ordering issue
        t.id.map(lambda x: x + 1, schema='int64', name='id'): [sql, mongo],
        t[t.amount > 50]['name']: [],
        by(t.name, total=t.amount.sum()): [],
        by(t.id, count=t.id.count()): [],
        by(t[['id', 'amount']], count=t.id.count()): [],
        by(t[['id', 'amount']], total=(t.amount + 1).sum()): [mongo],
        by(t[['id', 'amount']], n=t.name.nunique()): [mongo, bc],
        by(t.id, count=t.amount.count()): [],
        by(t.id, n=t.id.nunique()): [mongo, bc],
        # by(t, count=t.count()): [],
        # by(t.id, count=t.count()): [],
        t[['amount', 'id']]: [x], # https://github.com/numpy/numpy/issues/3256
        t[['id', 'amount']]: [x, bc], # bcolz sorting
        t[0]: [sql, mongo, bc],
        t[::2]: [sql, mongo, bc],
        t.id.utcfromtimestamp: [sql],
        t.distinct().nrows: [],
        t.nelements(axis=0): [],
        t.nelements(axis=None): [],
        t.amount.truncate(200): [sql]
    }
# {expr: [list-of-exclusions]}
expressions = {
        t: [],
        t['id']: [],
        abs(t['amount']): [],
        t.id.max(): [],
        t.amount.sum(): [],
        t.amount.sum(keepdims=True): [],
        t.amount.count(keepdims=True): [],
        t.amount.nunique(keepdims=True): [mongo],
        t.amount.nunique(): [],
        t.amount.head(): [],
        t.amount + 1: [mongo],
        sin(t.amount): [sql, mongo], # sqlite doesn't support trig
        exp(t.amount): [sql, mongo],
        t.amount > 50: [mongo],
        t[t.amount > 50]: [],
        t.like(name='Alic*'): [],
        t.sort('name'): [bc],
        t.sort('name', ascending=False): [bc],
        t.head(3): [],
        t.name.distinct(): [],
        t[t.amount > 50]['name']: [], # odd ordering issue
        t.id.map(lambda x: x + 1, schema='int64', name='id'): [sql, mongo],
        t[t.amount > 50]['name']: [],
        by(t.name, total=t.amount.sum()): [],
        by(t.id, count=t.id.count()): [],
        by(t[['id', 'amount']], count=t.id.count()): [],
        by(t[['id', 'amount']], total=(t.amount + 1).sum()): [mongo],
        by(t[['id', 'amount']], n=t.name.nunique()): [mongo, bc],
Exemple #4
0
# {expr: [list-of-exclusions]}
expressions = {
    t: [],
    t['id']: [],
    abs(t['amount']): [],
    t.id.max(): [],
    t.amount.sum(): [],
    t.amount.sum(keepdims=True): [],
    t.amount.count(keepdims=True): [],
    t.amount.nunique(keepdims=True): [mongo],
    t.amount.nunique(): [],
    t.amount.head(): [],
    t.amount + 1: [mongo],
    sin(t.amount): [sql, mongo],  # sqlite doesn't support trig
    exp(t.amount): [sql, mongo],
    t.amount > 50: [mongo],
    t[t.amount > 50]: [],
    t.like(name='Alic*'): [],
    t.sort('name'): [bc],
    t.sort('name', ascending=False): [bc],
    t.head(3): [],
    t.name.distinct(): [],
    t[t.amount > 50]['name']: [],  # odd ordering issue
    t.id.map(lambda x: x + 1, schema='int64', name='id'): [sql, mongo],
    t[t.amount > 50]['name']: [],
    by(t.name, total=t.amount.sum()): [],
    by(t.id, count=t.id.count()): [],
    by(t[['id', 'amount']], count=t.id.count()): [],
    by(t[['id', 'amount']], total=(t.amount + 1).sum()): [mongo],
    by(t[['id', 'amount']], n=t.name.nunique()): [mongo, bc],