-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sql): Adds url_download and url_upload to daft-sql (#3690)
- Loading branch information
Showing
15 changed files
with
382 additions
and
89 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,18 @@ | ||
mod download; | ||
mod upload; | ||
pub mod download; | ||
pub mod upload; | ||
|
||
use common_io_config::IOConfig; | ||
use daft_dsl::{functions::ScalarFunction, ExprRef}; | ||
use download::DownloadFunction; | ||
use upload::UploadFunction; | ||
use download::UrlDownloadArgs; | ||
use upload::UrlUploadArgs; | ||
|
||
/// Creates a `url_download` ExprRef from the positional and optional named arguments. | ||
#[must_use] | ||
pub fn download( | ||
input: ExprRef, | ||
max_connections: usize, | ||
raise_error_on_failure: bool, | ||
multi_thread: bool, | ||
config: Option<IOConfig>, | ||
) -> ExprRef { | ||
ScalarFunction::new( | ||
DownloadFunction { | ||
max_connections, | ||
raise_error_on_failure, | ||
multi_thread, | ||
config: config.unwrap_or_default().into(), | ||
}, | ||
vec![input], | ||
) | ||
.into() | ||
pub fn download(input: ExprRef, args: Option<UrlDownloadArgs>) -> ExprRef { | ||
ScalarFunction::new(args.unwrap_or_default(), vec![input]).into() | ||
} | ||
|
||
/// Creates a `url_upload` ExprRef from the positional and optional named arguments. | ||
#[must_use] | ||
pub fn upload( | ||
input: ExprRef, | ||
location: ExprRef, | ||
max_connections: usize, | ||
raise_error_on_failure: bool, | ||
multi_thread: bool, | ||
is_single_folder: bool, | ||
config: Option<IOConfig>, | ||
) -> ExprRef { | ||
ScalarFunction::new( | ||
UploadFunction { | ||
max_connections, | ||
raise_error_on_failure, | ||
multi_thread, | ||
is_single_folder, | ||
config: config.unwrap_or_default().into(), | ||
}, | ||
vec![input, location], | ||
) | ||
.into() | ||
pub fn upload(input: ExprRef, location: ExprRef, args: Option<UrlUploadArgs>) -> ExprRef { | ||
ScalarFunction::new(args.unwrap_or_default(), vec![input, location]).into() | ||
} |
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
Oops, something went wrong.