-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHORE] Enable read_sql for swordfish (#2918)
Enables read_sql tests for swordfish. Additionally adds an `EmptyScan` operator. This is needed because some sql tests produce 0 scan tasks (some other IO tests that are skipped also need empty scan, so this PR will enable those to pass as well, I will unskip them in future PRs). _Technically_, we don't need a dedicated empty scan operator for this, but it might be useful to be explicit. (For what it's worth the current runner does have an [empty scan operator](https://github.com/Eventual-Inc/Daft/blob/3f37a69e37211d5aa17f416096cb4eb9a22e3b7a/daft/execution/rust_physical_plan_shim.py#L53) as well) --------- Co-authored-by: Colin Ho <[email protected]> Co-authored-by: Colin Ho <[email protected]>
- Loading branch information
1 parent
64b8699
commit 73ff3f3
Showing
9 changed files
with
106 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -545,6 +545,10 @@ jobs: | |
matrix: | ||
python-version: ['3.8'] # can't use 3.7 due to requiring anon mode for adlfs | ||
daft-runner: [py, ray] | ||
enable-native-executor: [0, 1] | ||
exclude: | ||
- daft-runner: ray | ||
enable-native-executor: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -583,6 +587,7 @@ jobs: | |
pytest tests/integration/sql -m 'integration or not integration' --durations=50 | ||
env: | ||
DAFT_RUNNER: ${{ matrix.daft-runner }} | ||
DAFT_ENABLE_NATIVE_EXECUTOR: ${{ matrix.enable-native-executor }} | ||
- name: Send Slack notification on failure | ||
uses: slackapi/[email protected] | ||
if: ${{ failure() && (github.ref == 'refs/heads/main') }} | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use std::sync::Arc; | ||
|
||
use daft_core::prelude::SchemaRef; | ||
use daft_io::IOStatsRef; | ||
use daft_micropartition::MicroPartition; | ||
use tracing::instrument; | ||
|
||
use super::source::Source; | ||
use crate::{sources::source::SourceStream, ExecutionRuntimeHandle}; | ||
|
||
pub struct EmptyScanSource { | ||
schema: SchemaRef, | ||
} | ||
|
||
impl EmptyScanSource { | ||
pub fn new(schema: SchemaRef) -> Self { | ||
Self { schema } | ||
} | ||
pub fn boxed(self) -> Box<dyn Source> { | ||
Box::new(self) as Box<dyn Source> | ||
} | ||
} | ||
|
||
impl Source for EmptyScanSource { | ||
#[instrument(name = "EmptyScanSource::get_data", level = "info", skip_all)] | ||
fn get_data( | ||
&self, | ||
_maintain_order: bool, | ||
_runtime_handle: &mut ExecutionRuntimeHandle, | ||
_io_stats: IOStatsRef, | ||
) -> crate::Result<SourceStream<'static>> { | ||
let empty = Arc::new(MicroPartition::empty(Some(self.schema.clone()))); | ||
Ok(Box::pin(futures::stream::once(async { empty }))) | ||
} | ||
fn name(&self) -> &'static str { | ||
"EmptyScanSource" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod empty_scan; | ||
pub mod in_memory; | ||
pub mod scan_task; | ||
pub mod source; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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