[GLUTEN-1433][VL][FOLLOWUP] Fix TimestampNTZ schema validation never matching due to Scala object simpleName suffix#12029
Merged
Conversation
…matching due to Scala object simpleName suffix TimestampNTZType is a Scala case object, so getClass.getSimpleName returns "TimestampNTZType$" (with trailing $), causing the equality check against "TimestampNTZType" to always fail. This meant validateSchema would reject TimestampNTZ even when enableTimestampNtzValidation was set to false. Use catalogString == "timestamp_ntz" instead, which is reliable regardless of how the type is defined in Scala. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
cc @rui-mo @Mariamalmesfer. Could you help to review? |
Mariamalmesfer
approved these changes
May 5, 2026
Contributor
Mariamalmesfer
left a comment
There was a problem hiding this comment.
LGTM
@rui-mo can you take a look?
rui-mo
approved these changes
May 6, 2026
Contributor
rui-mo
left a comment
There was a problem hiding this comment.
Thanks @liujiayi771. This is a known issue, and I made a fix in our dev branch: https://github.com/apache/gluten/tree/ts_ntz_dev.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isPrimitiveTypeinVeloxValidatorApiusesdt.getClass.getSimpleName == "TimestampNTZType"to check for TimestampNTZ type. However,TimestampNTZTypeis a Scalacase object, sogetClass.getSimpleNamereturns"TimestampNTZType$"(with a trailing$), causing the check to always fail. This meansvalidateSchemarejects TimestampNTZ even whenenableTimestampNtzValidationis set tofalse.Fix: Use
dt.catalogString == "timestamp_ntz"instead, which is reliable regardless of how the type is defined in Scala.Test: Added a test in
VeloxParquetDataTypeValidationSuiteto verify thatvalidateSchemacorrectly accepts/rejects TimestampNTZ based on theenableTimestampNtzValidationconfig.Related issue: #1433