-
Notifications
You must be signed in to change notification settings - Fork 584
[GLUTEN-11550][VL][UT] Enable Variant test suites #11726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,6 +121,15 @@ object VeloxValidatorApi { | |
| case map: MapType => | ||
| validateSchema(map.keyType).orElse(validateSchema(map.valueType)) | ||
| case struct: StructType => | ||
| // Detect variant shredded struct produced by Spark's PushVariantIntoScan. | ||
| // These structs have all fields annotated with __VARIANT_METADATA_KEY metadata. | ||
| // Velox cannot read the variant shredding encoding in Parquet files. | ||
| if ( | ||
| struct.fields.nonEmpty && | ||
| struct.fields.forall(_.metadata.contains("__VARIANT_METADATA_KEY")) | ||
| ) { | ||
| return Some(s"Variant shredded struct is not supported: $struct") | ||
baibaichen marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might the struct $struct too heavy?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is consistent with the existing pattern at line 144: |
||
| } | ||
| struct.foreach { | ||
| field => | ||
| val reason = validateSchema(field.dataType) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,6 +237,8 @@ trait SparkShims { | |
|
|
||
| def isParquetFileEncrypted(footer: ParquetMetadata): Boolean | ||
|
|
||
| def shouldFallbackForParquetVariantAnnotation(footer: ParquetMetadata): Boolean = false | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We would we not fallback?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Default |
||
|
|
||
| def getOtherConstantMetadataColumnValues(file: PartitionedFile): JMap[String, Object] = | ||
| Map.empty[String, Any].asJava.asInstanceOf[JMap[String, Object]] | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add nonEmpty check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,
nonEmptyis needed becauseforallreturnstruefor an empty collection. Without it, an empty struct would be incorrectly detected as variant shredded.