cashmand commented on code in PR #45409:
URL: https://github.com/apache/spark/pull/45409#discussion_r1515515440


##########
sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala:
##########
@@ -175,6 +175,32 @@ trait CreatableRelationProvider {
       mode: SaveMode,
       parameters: Map[String, String],
       data: DataFrame): BaseRelation
+
+  /**
+   * Check if the relation supports the given data type.
+   *
+   * @param dt Data type to check
+   * @return True if the data type is supported
+   */
+  def supportsDataType(
+      dt: DataType
+  ): Boolean = {
+    dt match {
+      case ArrayType(e, _) => supportsDataType(e)
+      case MapType(k, v, _) =>
+        supportsDataType(k) && supportsDataType(v)
+      case StructType(fields) => fields.forall(f => 
supportsDataType(f.dataType))
+      case udt: UserDefinedType[_] => supportsDataType(udt.sqlType)
+      case _: AnsiIntervalType | CalendarIntervalType | VariantType => false
+      case BinaryType | BooleanType | ByteType | CalendarIntervalType | 
CharType(_) | DateType |
+           DayTimeIntervalType(_, _) | _ : DecimalType |  DoubleType | 
FloatType |

Review Comment:
   Oh, that was an accident. I'll remove from this list. I can have it only 
list supported types.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to