malinjawi commented on code in PR #12269:
URL: https://github.com/apache/gluten/pull/12269#discussion_r3395712186
##########
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxIteratorApi.scala:
##########
@@ -94,10 +94,33 @@ class VeloxIteratorApi extends IteratorApi with Logging {
val metadataColumns = partitionFiles
.map(
f => SparkShimLoader.getSparkShims.generateMetadataColumns(f,
metadataColumnNames).asJava)
- val otherMetadataColumns = partitionFiles
- .map(f =>
SparkShimLoader.getSparkShims.getOtherConstantMetadataColumnValues(f))
+ val (otherMetadataColumns, deltaReadOptions) =
+ DeltaSplitMetadataExtractor.normalize(partitionSchema.fields.length,
partitionFiles)
+ .getOrElse {
+ (
+ partitionFiles.map {
+ f =>
SparkShimLoader.getSparkShims.getOtherConstantMetadataColumnValues(f)
+ },
+ Seq.empty[DeltaFileReadOptions])
+ }
- setFileSchemaForLocalFiles(
+ val localFilesNode = if (deltaReadOptions.nonEmpty) {
+ DeltaLocalFilesBuilder.makeDeltaLocalFiles(
+ partitionIndex,
+ paths.asJava,
+ starts.asJava,
+ lengths.asJava,
+ fileSizes.asJava,
+ modificationTimes.asJava,
+ partitionColumns.map(_.asJava).asJava,
+ metadataColumns.asJava,
+ fileFormat,
+ locations.toList.asJava,
+ mapAsJavaMap(properties),
+ otherMetadataColumns.asJava,
+ deltaReadOptions.asJava
+ )
Review Comment:
Yea, I am now following the `IcebergScanTransformer` pattern.
`DeltaScanTransformer` now overrides `getSplitInfosFromPartitions` and
decorates the generic split infos with DV options only when a split actually
has DVs.
This also kills the reflection you flagged earlier: the extraction moved
into `gluten-delta` where Delta links directly, `DeltaSplitMetadataExtractor`
is deleted.
--
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]