voonhous commented on code in PR #19791:
URL: https://github.com/apache/hudi/pull/19791#discussion_r3886678158
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/ProvidesHoodieConfig.scala:
##########
@@ -232,23 +232,23 @@ trait ProvidesHoodieConfig extends Logging {
}
)
- val overwriteTableOpts = if
(operation.equals(BULK_INSERT_OPERATION_OPT_VAL)) {
+ val overwriteTableOpts = if
(operation.equalsIgnoreCase(BULK_INSERT_OPERATION_OPT_VAL)) {
Review Comment:
Verified at 7c36e9ba: `operation` lower-cased once with `Locale.ROOT` in
both `buildHoodieInsertConfig` and `deduceOverwriteConfig`, comparisons back to
`equals`. Resolving.
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/dml/insert/TestInsertTable5.scala:
##########
@@ -358,4 +358,80 @@ class TestInsertTable5 extends HoodieSparkSqlTestBase {
}
}
}
+
+ test("Test Insert Overwrite With Non Blocking Concurrency Control Is
Rejected") {
+ Seq("INSERT_OVERWRITE", "INSERT_OVERWRITE_TABLE").foreach { operation =>
+ withSQLConf(
+ "hoodie.write.concurrency.mode" -> "NON_BLOCKING_CONCURRENCY_CONTROL",
+ "hoodie.datasource.write.operation" -> operation
+ ) {
+ withTempDir { tmp =>
+ withTable(generateTableName) { tableName =>
+ val tablePath = s"""${tmp.getCanonicalPath}/$tableName"""
+ spark.sql(
+ s"""
+ |create table $tableName (
+ | id int,
+ | name string,
+ | price double,
+ | ts long
+ |) using hudi
+ | tblproperties (
+ | primaryKey = 'id',
+ | type = 'mor',
+ | preCombineField = 'ts',
+ | hoodie.index.type = 'BUCKET',
+ | hoodie.index.bucket.engine = 'SIMPLE',
+ | hoodie.bucket.index.hash.field = 'id',
+ | hoodie.bucket.index.num.buckets = 1)
+ | location '${tablePath}'
+ | """.stripMargin)
+
+ checkExceptionContain(
+ s"""insert into $tableName values
+ | (1, 'a1', 10, 1000)
+ | """.stripMargin)(
+ "Insert overwrite is not supported with non-blocking concurrency
control")
+ }
+ }
+ }
+ }
+ }
+
+ test("Test Insert Overwrite (bulk_insert mode) With Non Blocking Concurrency
Control Is Rejected") {
+ withSQLConf(
+ "hoodie.write.concurrency.mode" -> "NON_BLOCKING_CONCURRENCY_CONTROL",
+ "hoodie.datasource.write.operation" -> "BULK_INSERT"
Review Comment:
Verified at 7c36e9ba: `TestInsertTable3` "Test Insert Overwrite Bucket Index
Table" now loops `bulk_insert`/`BULK_INSERT` and asserts replacement. nit: its
comment attributes the old append to `deduceOverwriteConfig`; it was the
`equals` in `buildHoodieInsertConfig`. Resolving.
--
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]