cloud-fan commented on code in PR #45806:
URL: https://github.com/apache/spark/pull/45806#discussion_r1555293483
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala:
##########
@@ -360,8 +360,10 @@ object JsonInferSchema {
/**
* Returns the most general data type for two given data types.
+ * When the two types are incompatible, return `incompatibleType` as a
fallback result.
*/
- def compatibleType(t1: DataType, t2: DataType): DataType = {
+ def compatibleType(
+ t1: DataType, t2: DataType, incompatibleType: DataType = StringType):
DataType = {
Review Comment:
shall we call it `defaultType`?
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala:
##########
@@ -360,8 +360,10 @@ object JsonInferSchema {
/**
* Returns the most general data type for two given data types.
+ * When the two types are incompatible, return `incompatibleType` as a
fallback result.
*/
- def compatibleType(t1: DataType, t2: DataType): DataType = {
+ def compatibleType(
+ t1: DataType, t2: DataType, incompatibleType: DataType = StringType):
DataType = {
Review Comment:
shall we call it `defaultDataType`?
--
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]