Scott Moreland
11/23/2020, 12:58 PMsql_context.read.tableKyle Moon-Wright
11/23/2020, 4:47 PMScott Moreland
11/23/2020, 5:01 PMKyle Moon-Wright
11/23/2020, 6:12 PMScott Moreland
11/23/2020, 6:22 PMScott Moreland
11/23/2020, 6:22 PMKyle Moon-Wright
11/23/2020, 6:52 PMtargetlocationtargetScott Moreland
11/23/2020, 7:06 PMsql_context = create_sql_context()
db_result = HiveResult(sql_context, location='task_output_table_name')
@task(target='task_output_table_name', result=db_result)
def create_table(sql_context):
    """Transform a table"""
    
    sdf = sql_context.read.table('database.src_table_name')
    
    sdf = sdf.groupby('col1').agg(sf.sum('col2').alias('sum'))
    
    db_result.write(sdf)
           
    return sdfdb_result.write(sdf)Kyle Moon-Wright
11/23/2020, 7:18 PMwriteHiveResult/db_resultScott Moreland
11/23/2020, 7:20 PMScott Moreland
11/23/2020, 7:27 PMKyle Moon-Wright
11/23/2020, 7:28 PMKyle Moon-Wright
11/23/2020, 7:28 PMcreate_tableKyle Moon-Wright
11/23/2020, 7:30 PMScott Moreland
11/23/2020, 9:35 PMprefect.config.checkpointingKyle Moon-Wright
11/23/2020, 9:40 PM