yihua commented on code in PR #10999:
URL: https://github.com/apache/hudi/pull/10999#discussion_r1561708412
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestMORDataSource.scala:
##########
@@ -1405,4 +1405,24 @@ class TestMORDataSource extends
HoodieSparkClientTestBase with SparkDatasetMixin
basePath
}
}
+
+ @Test
+ def testMergerStrategySet(): Unit = {
+ val (writeOpts, _) = getWriterReaderOpts()
+ val input = recordsToStrings(dataGen.generateInserts("000", 1)).asScala
+ val inputDf= spark.read.json(spark.sparkContext.parallelize(input, 1))
+ val mergerStrategyName = "asfdasf"
Review Comment:
make a more readable name here?
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala:
##########
@@ -309,6 +310,7 @@ class HoodieSparkSqlWriterInternal {
.setPartitionMetafileUseBaseFormat(useBaseFormatMetaFile)
.setShouldDropPartitionColumns(hoodieConfig.getBooleanOrDefault(HoodieTableConfig.DROP_PARTITION_COLUMNS))
.setCommitTimezone(timelineTimeZone)
+ .setRecordMergerStrategy(recordMergerStrategy)
Review Comment:
inline the
`hoodieConfig.getStringOrDefault(DataSourceWriteOptions.RECORD_MERGER_STRATEGY)`?
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestMORDataSource.scala:
##########
@@ -1405,4 +1405,24 @@ class TestMORDataSource extends
HoodieSparkClientTestBase with SparkDatasetMixin
basePath
}
}
+
+ @Test
+ def testMergerStrategySet(): Unit = {
+ val (writeOpts, _) = getWriterReaderOpts()
+ val input = recordsToStrings(dataGen.generateInserts("000", 1)).asScala
+ val inputDf= spark.read.json(spark.sparkContext.parallelize(input, 1))
+ val mergerStrategyName = "asfdasf"
+ inputDf.write.format("org.apache.hudi")
Review Comment:
```suggestion
inputDf.write.format("hudi")
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]