You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Nikolay Ivanitskiy (Jira)" <ji...@apache.org> on 2021/08/02 16:37:00 UTC

[jira] [Created] (SPARK-36385) Add possibility for jdbc insert hints

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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org