HowlyBlood commented on PR #47186:
URL: https://github.com/apache/airflow/pull/47186#issuecomment-2702493325

   Hi, this is my first "contribution", even if it is just a suggestion. I'm 
clearly new to this, but I was wondering if some users has some statement like 
   ```
   CREATE TABLE example (id INT); -- added ; in a comment. If the split is not 
"comment zone safe", it may raise an error
   INSERT INTO example (id) VALUES (1);
   SELECT * FROM 
   ```
   or `"BEGIN; ... COMMIT;"` which makes no sense if executed in multiple 
statements .
   As `split_statement` was initially false, it was behaving correctly, but now 
it may not behave as expected
   
   I'm not sure if it's a good solution, but providing `split_statements = 
hasattr(sql,'__iter__')` would prevent any unexpected behavior: if it's not a 
iterable, it would not split. No changes from before the update.  
   
   I'm still looking for the split_statement's definition, but I think it is 
splitting **str** with semicolon and **iterables** by their elements, so it 
might be an intuitive way to code : you use an iterable if you want it to be 
split, otherwise, you use a single string (for a single statement) 
   
   ["DESCRIBE ... ;","SELECT ...;","BEGIN; ... ; COMMIT;"] --> split_statement 
= True
   "BEGIN; ... ; COMMIT;" --> split_statement = False
   
   I'm not a native English speaker, so tell me if i'm not easy to understand, 
and i'll try to explain my point of view. 
   
   Good job anyway, you pointed out something interesting.
   
   Thanks to this issue, I learnt some new things like @overload, which I had 
already encountered in Java but never explored. Java wasn't in my career path, 
but seeing it in Python made me look for explanations. I'm still learning, and 
this was a great opportunity to expand my beginner knowledge.
   
   See you ! 
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to