-
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.
[BUG] Avoid reconstructing sql query in read_sql (#2818)
When Daft executes a read_sql scan task, it calls the `def read_sql` function in table_io.py. This function then calls the `.read` method on the SQLConnection object. However, the `.read` method will reconstruct the sql query and add another layer of subqueries, which is unnecessary. This is because the `.read` method constructs a sql query given additional predicates, projections, and limits, then executes it. However, the scan task is already given a constructed query with pushdowns applied, so this reconstruction is unnecessary. This PR removes the `.read` method and instead exposes the `execute_sql_query` method. Having `.read` do construction and execution together is confusing. --------- Co-authored-by: Colin Ho <[email protected]>
- Loading branch information
Showing
3 changed files
with
11 additions
and
22 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
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