You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Istvan Toth (Jira)" <ji...@apache.org> on 2022/02/08 09:14:00 UTC

[jira] [Resolved] (PHOENIX-6229) When dataframe write Phoniex,saveMode will report an error only if it is not set to overwrite mode

     [ https://issues.apache.org/jira/browse/PHOENIX-6229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Istvan Toth resolved PHOENIX-6229.
----------------------------------
    Resolution: Not A Bug

The message and the check are consistent.
The intention is to throw an error if the SaveMode is NOT overwite.

The messages says: "SaveMode other than SaveMode.OverWrite is not supported"
Which is equivalent to:"Only SaveMode.OverWrite is supported"

There is a broader issue that Overwrite seems to imply that we drop the table, and create a new one, which is not true, and we should really insist on using SaveMode.append instead, which is closer to how the connector actually works.

At this point I wouldn't break existing client code that was written to use SaveMode.OverWrite, so I'll just let that pass.

The new Spark3 API omits SaveMode.

> When dataframe write Phoniex,saveMode will report an error only if it is not set to overwrite mode
> --------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6229
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6229
>             Project: Phoenix
>          Issue Type: Bug
>          Components: spark-connector
>    Affects Versions: 5.0.0
>         Environment: jar-version 
> <dependency>
>  <groupId>org.apache.phoenix</groupId>
>  <artifactId>phoenix-spark</artifactId>
>  <version>5.0.0-HBase-2.0</version>
>  </dependency>
> my code:
> dataFrame.write
>  .format("org.apache.phoenix.spark")
>  .option("table", table)
>  .option("zkUrl", zkUrl)
>  .option("skipNormalizingIdentifier", true)
>  .save()
>  }
>            Reporter: 何军红
>            Priority: Minor
>         Attachments: image-2020-11-19-17-17-43-669.png
>
>
>  org.apache.phoenix.spark.DefaultSource
> Savemode will not report errors unless it is set to overwrite,But the message to throw an exception is that overwrite is not supported
>  think it might be written like this,The logic is the opposite
> if (mode.equals(SaveMode.Overwrite))
> { throw new Exception("SaveMode other than SaveMode.OverWrite is not supported") }
> !image-2020-11-19-17-17-43-669.png|width=648,height=149!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)