-
Notifications
You must be signed in to change notification settings - Fork 450
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
[GLUTEN-5320][VL] Reduce driver memory footprint by postpone the creation and serialization of LocalFilesNode #5321
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.gluten.substrait.rel; | ||
|
||
import org.apache.gluten.exception.GlutenException; | ||
|
||
import com.google.protobuf.MessageOrBuilder; | ||
import org.apache.spark.sql.execution.datasources.FilePartition; | ||
import org.apache.spark.sql.types.StructType; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class RawSplitInfo implements SplitInfo { | ||
private FilePartition filePartition; | ||
private StructType partitionSchema; | ||
private LocalFilesNode.ReadFileFormat readFileFormat; | ||
|
||
private List<String> metadataColumns; | ||
|
||
public RawSplitInfo( | ||
FilePartition filePartition, | ||
StructType partitionSchema, | ||
LocalFilesNode.ReadFileFormat readFileFormat, | ||
List<String> metadataColumns) { | ||
this.filePartition = filePartition; | ||
this.partitionSchema = partitionSchema; | ||
this.readFileFormat = readFileFormat; | ||
this.metadataColumns = metadataColumns; | ||
} | ||
|
||
public FilePartition getFilePartition() { | ||
return filePartition; | ||
} | ||
|
||
public List<String> getMetadataColumns() { | ||
return metadataColumns; | ||
} | ||
|
||
public StructType getPartitionSchema() { | ||
return partitionSchema; | ||
} | ||
|
||
public LocalFilesNode.ReadFileFormat getReadFileFormat() { | ||
return readFileFormat; | ||
} | ||
|
||
@Override | ||
public List<String> preferredLocations() { | ||
return Arrays.asList(filePartition.preferredLocations()); | ||
} | ||
Comment on lines
+63
to
+65
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.
please keep origin logic. |
||
|
||
@Override | ||
public MessageOrBuilder toProtobuf() { | ||
throw new GlutenException("RawSpiltInfo.toProtobuf should not be used"); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
package org.apache.gluten.backendsapi | ||
|
||
import org.apache.gluten.GlutenNumaBindingInfo | ||
import org.apache.gluten.execution.{BaseGlutenPartition, BasicScanExecTransformer, WholeStageTransformContext} | ||
import org.apache.gluten.execution.{BaseGlutenPartition, BasicScanExecTransformer, GlutenRawPartition, WholeStageTransformContext} | ||
import org.apache.gluten.metrics.IMetrics | ||
import org.apache.gluten.substrait.plan.PlanNode | ||
import org.apache.gluten.substrait.rel.LocalFilesNode.ReadFileFormat | ||
|
@@ -91,4 +91,6 @@ trait IteratorApi { | |
numOutputRows: SQLMetric, | ||
numOutputBatches: SQLMetric, | ||
scanTime: SQLMetric): RDD[ColumnarBatch] | ||
|
||
def toLocalFilesNodeByteArray(p: GlutenRawPartition): Array[Array[Byte]] | ||
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. could we add a new SplitInfo object file and move this method into it with |
||
} |
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.
Not introduce this package. Just use
JArrayList
.