Skip to content

Conversation

asl3
Copy link

@asl3 asl3 commented Sep 30, 2025

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Description

Allowlist for kernel-Spark connector supported schema data types.

We now fail with a more descriptive error message when schema data types are unsupported:

java.lang.IllegalArgumentException: Unsupported data type 'variant' for field 'v'. 

How was this patch tested?

Added a new golden table file, variant-spark-checkpoint

Does this PR introduce any user-facing changes?

Yes, updates the user-facing error message to be more descriptive

@asl3 asl3 changed the title validate Handle unsupported data types in kernel-spark connector Oct 5, 2025
@asl3 asl3 changed the title Handle unsupported data types in kernel-spark connector [Kernel connector] Handle unsupported data types in kernel-spark connector Oct 5, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we rename spark-variant-checkpoint to just variant?

assertThrows(
RuntimeException.class,
() -> {
spark.sql("SELECT * FROM `dsv2`.`delta`.`" + tablePath + "`").collect();
Copy link
Contributor

Choose a reason for hiding this comment

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

The error comes from:

	at io.delta.kernel.spark.utils.SchemaUtils.convertKernelDataTypeToSparkDataType(SchemaUtils.java:116)
	at io.delta.kernel.spark.utils.SchemaUtils.convertKernelSchemaToSparkSchema(SchemaUtils.java:60)

It seesm that it is already handled in SchemaUtils. In such a case, we can just remove all the code changes in SparkTable.java

Copy link
Contributor

Choose a reason for hiding this comment

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

In the future, when getting table schema from Unity catalog, we can check whether the UC schema is supported in Kernel. For example, the Time type is not supported yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants