smolnar82 commented on PR #1374:
URL: https://github.com/apache/knox/pull/1374#issuecomment-5525842786

   Thanks for the review discussion, @hanicz . Summarizing what we agreed so 
it's on the record:
   
   This PR (now):
   - Fix `removeLicenceHeader` to strip only `--` comment lines instead of 
cutting everything before the first `CREATE TABLE`. This removes SQL from 
nothing, so the Postgres `pg_advisory_lock(...)` statements survive. Addressing 
the fragility flagged in review while keeping the current parsing approach.
   - Merge as-is once that's in.
   
   Why not the fuller refactor yet: moving table creation to a pure SQL layer 
(DB-level `CREATE TABLE IF NOT EXISTS`, no Java-side splitting/guard) is 
blocked by two engines:
   - Oracle:  no `IF NOT EXISTS`, but solvable purely in SQL by wrapping the 
DDL in a PL/SQL block in the Oracle files.
   - Derby: no `IF NOT EXISTS` and can't execute a multi-statement script in 
one call; it's the one that forces the Java splitting. Derby is slated to be 
dropped.
   
   Follow-up (separate JIRA, after 
[KNOX-3401](https://issues.apache.org/jira/browse/KNOX-3401) and once Derby is 
removed): switch to the pure SQL layer (Oracle handled via PL/SQL, everyone 
else via IF NOT EXISTS) and delete the Java-side parsing/splitting entirely. 
I'll file the JIRA to track this.
   


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