SEPURI-SAI-KRISHNA opened a new issue, #19669:
URL: https://github.com/apache/hudi/issues/19669
## Bug Description
**What happened:**
The documentation of
`hoodie.datasource.write.slash.separated.date.partitioning` states the
constraint outright:
> "Flag to indicate whether to use slash separated date partitioning. If set
to true, date
> partition values in yyyy-MM-dd format will be transformed to yyyy/MM/dd
directory structure.
> By default false. **Cannot be used together with hive-style
partitioning.**"
Only SQL DDL enforces it. `HoodieCatalogTable#extraTableConfig` rejects the
combination by
inspecting `sqlOptions`, but `HoodieWriterUtils`, `HoodieSparkSqlWriter` and
`BaseKeyGenerator`
have no equivalent check, so `df.write.format("hudi")` and HoodieStreamer
accept
`hive_style_partitioning=true` together with
`slash.separated.date.partitioning=true`.
For a single partition field the two write paths then disagree, and both are
live (Avro versus
Spark record type, plus the row writer):
| path | partition directory |
|---|---|
| Avro (`KeyGenUtils#getPartitionPath`) | `date_col=2026/01/05` |
| Row / InternalRow (`PartitionPathFormatterBase`) | `date_col=2026-01-05` |
The Avro layout is also not readable back:
`HoodieSparkUtils#doParsePartitionColumnValues` takes the `date_col=` prefix
branch and never
restores `/` to `-`.
**What you expected:**
A documented-invalid combination should be rejected by every writer, not
only by SQL DDL.
**Steps to reproduce:**
1. `df.write.format("hudi")` with both
`hoodie.datasource.write.hive_style_partitioning=true` and
`hoodie.datasource.write.slash.separated.date.partitioning=true`, one
date partition column.
2. The write is accepted; compare the directory produced by the Avro path
against the row-writer
one, and read the Avro-written table back.
**Suggested fix:**
Add the mutual-exclusion check to `HoodieWriterUtils.validateTableConfig` so
it applies to every
write path, matching what the config documentation already promises.
Raised during review of #19648.
## Environment
**Hudi version:** master (1.3.0-SNAPSHOT)
**Query engine:** Spark (`df.write` / HoodieStreamer, i.e. not SQL DDL)
**Relevant configs:** `hoodie.datasource.write.hive_style_partitioning=true`
+
`hoodie.datasource.write.slash.separated.date.partitioning=true`
## Logs and Stack Trace
No failure at write time -- the layouts simply diverge, and the Avro-written
one does not read
back correctly.
--
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]