leesf commented on a change in pull request #1783:
URL: https://github.com/apache/hudi/pull/1783#discussion_r450186528
##########
File path: hudi-spark/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala
##########
@@ -52,10 +52,14 @@ private[hudi] object HoodieSparkSqlWriter {
val sparkContext = sqlContext.sparkContext
val path = parameters.get("path")
- val tblName = parameters.get(HoodieWriteConfig.TABLE_NAME)
- if (path.isEmpty || tblName.isEmpty) {
+ var tblName_tmp = parameters.get(HoodieWriteConfig.TABLE_NAME)
+
+ if ( !path.isEmpty && !tblName_tmp.isEmpty) {
+ val tblName = tblName_tmp.get.trim
+ }else{
throw new HoodieException(s"'${HoodieWriteConfig.TABLE_NAME}', 'path'
must be set.")
}
+
Review comment:
this would be replaced with
```java
val tblNameOp = parameters.get(HoodieWriteConfig.TABLE_NAME)
if (path.isEmpty || tblNameOp.isEmpty) {
throw new HoodieException(s"'${HoodieWriteConfig.TABLE_NAME}', 'path'
must be set.")
}
val tblName = tblNameOp.get.trim
```
----------------------------------------------------------------
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]