Nikolay Ivanitskiy created SPARK-36385:
------------------------------------------

             Summary: Add possibility for jdbc insert hints
                 Key: SPARK-36385
                 URL: https://issues.apache.org/jira/browse/SPARK-36385
             Project: Spark
          Issue Type: Improvement
          Components: Spark Core
    Affects Versions: 2.4.7
            Reporter: Nikolay Ivanitskiy


Some SQL backends supports hints for SQL insert statement, such as
{code:java}
/*+ ignore_row_on_dupkey_index ( table(col1, col2, ...) ) */ {code}
for example.
{code:java}
insert  /*+ ignore_row_on_dupkey_index ( table(col1, col2, ...) ) */ into 
table(...{code}
But spark jdbc writer does not allow to add hints.

I suggest to add support for hints in 
org.apache.spark.sql.execution.datasources.jdbc.JdbsUtils.getInsertStatement 
and 
org.apache.spark.sql.execution.datasources.jdbc.JdbsUtils.getInsertStatement.saveTable

Hints should be stored in options.

I already have version with hints support so if issue will be accepted I can 
post the fix.

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to