You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "zhongjiajie (JIRA)" <ji...@apache.org> on 2019/01/25 17:34:00 UTC

[jira] [Created] (AIRFLOW-3767) oracle hook bulk insert error while target_fields is DEFAULT values

zhongjiajie created AIRFLOW-3767:
------------------------------------

             Summary: oracle hook bulk insert error while target_fields is DEFAULT values
                 Key: AIRFLOW-3767
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3767
             Project: Apache Airflow
          Issue Type: Bug
          Components: hooks
    Affects Versions: 1.10.2
            Reporter: zhongjiajie
            Assignee: zhongjiajie


{code:java}
def bulk_insert_rows(self, table, rows, target_fields=None, commit_every=5000):
    conn = self.get_conn()
    cursor = conn.cursor()
    values = ', '.join(':%s' % i for i in range(1, len(target_fields) + 1))
    prepared_stm = 'insert into {tablename} ({columns}) values ({values})'.format(
        tablename=table,
        columns=', '.join(target_fields),
        values=values,
    )
{code}
*target_fields* default *None* will leads 

 
{code:java}
len(target_fields)
{code}
and 
{code:java}
', '.join(target_fields)
{code}
fail

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)