You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/08/19 12:37:47 UTC

[GitHub] [airflow] hewerthomn commented on pull request #23971: Unify DbApiHook.run() method with the methods which override it

hewerthomn commented on PR #23971:
URL: https://github.com/apache/airflow/pull/23971#issuecomment-1220625752

   After this update, every statement using OracleOperator now fails,
   
   ```
   [2022-08-19, 04:09:47 -04] {sql.py:315} INFO - Running statement:
   DECLARE
       v_sql LONG;
   BEGIN
       v_sql := '
   CREATE TABLE usr_bi_cgj.aguarda_recebimento_mandado
   (
       nr_processo         VARCHAR2(25) NOT NULL,
       ds_tarefa           VARCHAR2(300) NOT NULL,
       dt_inicial          TIMESTAMP(6) NOT NULL ,
       id_orgaojulgador    NUMBER(15) NOT NULL,
       cd_especie          VARCHAR2(200) NOT NULL,
       qt_dias             NUMBER(22) NOT NULL
   )
   ';
       EXECUTE IMMEDIATE v_sql;
       COMMIT;
       EXCEPTION
           WHEN OTHERS
           THEN EXECUTE IMMEDIATE 'TRUNCATE TABLE usr_bi_cgj.aguarda_recebimento_mandado';
       COMMIT;
   END
   , parameters: None
   [2022-08-19, 04:09:47 -04] {taskinstance.py:1909} ERROR - Task failed with exception
   Traceback (most recent call last):
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/providers/oracle/operators/oracle.py", line 69, in execute
       hook.run(self.sql, autocommit=self.autocommit, parameters=self.parameters)
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/providers/common/sql/hooks/sql.py", line 295, in run
       self._run_command(cur, sql_statement, parameters)
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/providers/common/sql/hooks/sql.py", line 320, in _run_command
       cur.execute(sql_statement)
     File "/home/airflow/.local/lib/python3.7/site-packages/oracledb/cursor.py", line 378, in execute
       impl.execute(self)
     File "src/oracledb/impl/thin/cursor.pyx", line 121, in oracledb.thin_impl.ThinCursorImpl.execute
     File "src/oracledb/impl/thin/protocol.pyx", line 375, in oracledb.thin_impl.Protocol._process_single_message
     File "src/oracledb/impl/thin/protocol.pyx", line 376, in oracledb.thin_impl.Protocol._process_single_message
     File "src/oracledb/impl/thin/protocol.pyx", line 369, in oracledb.thin_impl.Protocol._process_message
   oracledb.exceptions.DatabaseError: ORA-06550: linha 21, coluna 3:
   PLS-00103: Encontrado o símbolo "end-of-file" quando um dos seguintes símbolos era esperado:
   
      ; <um identificador>
      <um identificador delimitado por aspas duplas>
   O símbolo ";" foi substituído por "end-of-file" para continuar
   ```
   
   OracleOperator using only single query works, but all operators using block BEGIN now fails with similar message like this:
   ```
   PLS-00103: Encontrado o símbolo "end-of-file" quando um dos seguintes símbolos era esperado:
   
      ; <um identificador>
      <um identificador delimitado por aspas duplas>
   O símbolo ";" foi substituído por "end-of-file" para continuar
   ```


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org