[ 
https://issues.apache.org/jira/browse/AIRFLOW-3767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16783407#comment-16783407
 ] 

ASF GitHub Bot commented on AIRFLOW-3767:
-----------------------------------------

Fokko commented on pull request #4773: [AIRFLOW-3767] Correct bulk insert 
function
URL: https://github.com/apache/airflow/pull/4773
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> 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
>            Priority: Major
>              Labels: easyfix
>
> {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)

Reply via email to