destinations.job_client_impl
SqlLoadJob Objects
class SqlLoadJob(LoadJob)
A job executing sql statement, without followup trait
SqlJobClientBase Objects
class SqlJobClientBase(JobClientBase, WithStateSync)
maybe_ddl_transaction
@contextlib.contextmanager
def maybe_ddl_transaction() -> Iterator[None]
Begins a transaction if sql client supports it, otherwise works in auto commit.
create_table_chain_completed_followup_jobs
def create_table_chain_completed_followup_jobs(
table_chain: Sequence[TTableSchema]) -> List[NewLoadJob]
Creates a list of followup jobs for merge write disposition and staging replace strategies
start_file_load
def start_file_load(table: TTableSchema, file_path: str,
load_id: str) -> LoadJob
Starts SqlLoadJob for files ending with .sql or returns None to let derived classes to handle their specific jobs
restore_file_load
def restore_file_load(file_path: str) -> LoadJob
Returns a completed SqlLoadJob or None to let derived classes to handle their specific jobs
Returns completed jobs as SqlLoadJob is executed atomically in start_file_load so any jobs that should be recreated are already completed. Obviously the case of asking for jobs that were never created will not be handled. With correctly implemented loader that cannot happen.
Arguments:
file_path
str - a path to a job file
Returns:
LoadJob
- A restored job or none