You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "何军红 (Jira)" <ji...@apache.org> on 2020/11/20 05:52:00 UTC

[jira] [Updated] (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 ]

何军红 updated PHOENIX-6229:
-------------------------
    Description: 
 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!

  was:
 org.apache.phoenix.spark.DefaultSource

只有saveMode是overwrite才不会抛异常,但抛异常的信息是不支持overwrite

应该是

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!

    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()
 }

  was:
版本

<dependency>
 <groupId>org.apache.phoenix</groupId>
 <artifactId>phoenix-spark</artifactId>
 <version>5.0.0-HBase-2.0</version>
</dependency>

我的写法

dataFrame.write
 .format("org.apache.phoenix.spark")
 .mode("overwrite")
 .option("table", table)
 .option("zkUrl", zkUrl)
 .option("skipNormalizingIdentifier", true)
 .save()
}

        Summary: When dataframe write Phoniex,saveMode will report an error only if it is not set to overwrite mode  (was: dataframe写入phoniex时,saveMode设置为除了overwrite方式时都会报错)

> 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.3.4#803005)