moomindani commented on a change in pull request #28953:
URL: https://github.com/apache/spark/pull/28953#discussion_r452149303



##########
File path: docs/sql-data-sources-jdbc.md
##########
@@ -156,6 +156,20 @@ the following case-insensitive options:
      </td>
   </tr>
 
+  <tr>
+     <td><code>preActions</code></td>
+     <td>
+       Custom queries which you want to run before reading data from JDBC or 
writing data to JDBC. Only DDL or DML (insert/update/delete) are allowed. It is 
called per DataFrame, not per session. You can specify multiple queries 
separated by semicolon. When exceptions occur in preActions, the queries in 
preActions will be rollbacked. 

Review comment:
       You are right.. this logic should not be implemented here.
   
   I moved it to `createRelation` to make sure that it is called only once and 
to have consistency in the timing for both read path and write path.
   I also updated the document to describe the differences.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to