Skip to content
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

Preserve tags on FileSourceScanExec [databricks] #10461

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -339,7 +339,9 @@ abstract class Spark31XShims extends Spark31Xuntil33XShims with Logging {
override def tagPlanForGpu(): Unit = GpuFileSourceScanExec.tagSupport(this)

override def convertToCpu(): SparkPlan = {
wrapped.copy(partitionFilters = partitionFilters)
val cpu = wrapped.copy(partitionFilters = partitionFilters)
cpu.copyTagsFrom(wrapped)
cpu
Comment on lines +342 to +344
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have the same code for all shims. Can we extract that to a base class/function and get rid of all these repeated ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it OK if that's tracked as a followup? There's a lot more than this method duplicated between shims, and this is trying to unblock the 24.02 release.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, I'm fine with that.

}

override def convertToGpu(): GpuExec = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
* Copyright (c) 2022-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -85,7 +85,9 @@ class BatchScanExecMeta(p: BatchScanExec,
}

override def convertToCpu(): SparkPlan = {
wrapped.copy(runtimeFilters = runtimeFilters)
val cpu = wrapped.copy(runtimeFilters = runtimeFilters)
cpu.copyTagsFrom(wrapped)
cpu
}

override def convertToGpu(): GpuExec =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
* Copyright (c) 2022-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -82,7 +82,9 @@ class FileSourceScanExecMeta(plan: FileSourceScanExec,
override def tagPlanForGpu(): Unit = ScanExecShims.tagGpuFileSourceScanExecSupport(this)

override def convertToCpu(): SparkPlan = {
wrapped.copy(partitionFilters = partitionFilters)
val cpu = wrapped.copy(partitionFilters = partitionFilters)
cpu.copyTagsFrom(wrapped)
cpu
}

override def convertToGpu(): GpuExec = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
* Copyright (c) 2022-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -126,7 +126,9 @@ class FileSourceScanExecMeta(plan: FileSourceScanExec,
}

override def convertToCpu(): SparkPlan = {
wrapped.copy(partitionFilters = partitionFilters, dataFilters = dataFilters)
val cpu = wrapped.copy(partitionFilters = partitionFilters, dataFilters = dataFilters)
cpu.copyTagsFrom(wrapped)
cpu
}

override def convertToGpu(): GpuExec = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -76,7 +76,9 @@ class BatchScanExecMeta(p: BatchScanExec,
}

override def convertToCpu(): SparkPlan = {
wrapped.copy(runtimeFilters = runtimeFilters)
val cpu = wrapped.copy(runtimeFilters = runtimeFilters)
cpu.copyTagsFrom(wrapped)
cpu
}

override def convertToGpu(): GpuExec =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -75,7 +75,9 @@ class BatchScanExecMeta(p: BatchScanExec,
}

override def convertToCpu(): SparkPlan = {
wrapped.copy(runtimeFilters = runtimeFilters)
val cpu = wrapped.copy(runtimeFilters = runtimeFilters)
cpu.copyTagsFrom(wrapped)
cpu
}

override def convertToGpu(): GpuExec = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -73,7 +73,9 @@ class BatchScanExecMeta(p: BatchScanExec,
}

override def convertToCpu(): SparkPlan = {
wrapped.copy(runtimeFilters = runtimeFilters)
val cpu = wrapped.copy(runtimeFilters = runtimeFilters)
cpu.copyTagsFrom(wrapped)
cpu
}

override def convertToGpu(): GpuExec = {
Expand Down
Loading