Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions datafusion/common/src/config.rs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If 'legacy_java_charsets' does not accept every Java charset, is the name honest?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely. It accepts Java’s aliases for the nine charsets encode supports, not every Java charset. I kept the name because it mirrors spark.sql.legacy.javaCharsets, but I can change the docs to say exactly that, or rename it if you think that is clearer.

Original file line number Diff line number Diff line change
Expand Up @@ -2253,6 +2253,26 @@ config_namespace! {
///
/// Values are case-insensitive.
pub map_key_dedup_policy: MapKeyDedupPolicy, default = MapKeyDedupPolicy::Exception

/// If true, the Spark-compatible `encode` function accepts any charset name
/// it knows, including aliases such as `UTF8`, `LATIN1` and `UTF-32BE`, as
/// Spark 3.x did. If false (default), `encode` accepts only `us-ascii`,
/// `iso-8859-1`, `utf-8`, `utf-16be`, `utf-16le`, `utf-16` and `utf-32`
/// (case-insensitive) and raises `[INVALID_PARAMETER_VALUE.CHARSET]` for any
/// other name, as Spark 4.0 and later do.
///
/// Mirrors Spark's
/// [`spark.sql.legacy.javaCharsets`](https://github.com/apache/spark/blob/v4.2.0/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala).
pub legacy_java_charsets: bool, default = false

/// If true, the Spark-compatible `encode` function replaces a character that
/// the target charset cannot represent with `?`, as Spark 3.x did. If false
/// (default), `encode` raises `[MALFORMED_CHARACTER_CODING]`, as Spark 4.0 and
/// later do.
///
/// Mirrors Spark's
/// [`spark.sql.legacy.codingErrorAction`](https://github.com/apache/spark/blob/v4.2.0/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala).
pub legacy_coding_error_action: bool, default = false
}
}

Expand Down
Loading