xiaonanyang-db commented on code in PR #38113:
URL: https://github.com/apache/spark/pull/38113#discussion_r989473903
##########
connector/avro/src/main/scala/org/apache/spark/sql/avro/AvroOptions.scala:
##########
@@ -116,21 +121,27 @@ private[sql] class AvroOptions(
* taken into account. If the former one is not set too, the `snappy` codec
is used by default.
*/
val compression: String = {
- parameters.get("compression").getOrElse(SQLConf.get.avroCompressionCodec)
+ parameters.get(COMPRESSION).getOrElse(SQLConf.get.avroCompressionCodec)
}
val parseMode: ParseMode =
- parameters.get("mode").map(ParseMode.fromString).getOrElse(FailFastMode)
+ parameters.get(MODE).map(ParseMode.fromString).getOrElse(FailFastMode)
/**
* The rebasing mode for the DATE and TIMESTAMP_MICROS, TIMESTAMP_MILLIS
values in reads.
*/
val datetimeRebaseModeInRead: String = parameters
- .get(AvroOptions.DATETIME_REBASE_MODE)
+ .get(DATETIME_REBASE_MODE)
.getOrElse(SQLConf.get.getConf(SQLConf.AVRO_REBASE_MODE_IN_READ))
}
private[sql] object AvroOptions {
+ val avroOptionNames: mutable.Set[String] = collection.mutable.Set[String]()
+ private def newOption(name: String): String = {
+ avroOptionNames += name.toLowerCase(Locale.ROOT)
+ name
+ }
+
Review Comment:
@brkyvz why do we need to know of the relationship between alternative
options? Can't we just register both in the list and let the options class
itself figure out which is alternative to which?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]