Skip to content

Commit

Permalink
lazy from with http
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyhunkerti committed Sep 24, 2024
1 parent ee0d4ae commit 3e8a324
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/explorer/polars_backend/lazy_frame.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ defmodule Explorer.PolarsBackend.LazyFrame do

alias FSS.Local
alias FSS.S3
alias FSS.HTTP

import Explorer.PolarsBackend.Expression, only: [to_expr: 1, alias_expr: 2]

Expand Down Expand Up @@ -209,6 +210,14 @@ defmodule Explorer.PolarsBackend.LazyFrame do
end
end

@impl true
def from_parquet(%HTTP.Entry{url: url}, max_rows, columns, _rechunk) do
case Native.lf_from_parquet(url, max_rows, columns) do
{:ok, polars_ldf} -> Shared.create_dataframe(polars_ldf)
{:error, error} -> {:error, RuntimeError.exception(error)}
end
end

@impl true
def from_parquet(%Local.Entry{} = entry, max_rows, columns, _rechunk) do
case Native.lf_from_parquet(entry.path, max_rows, columns) do
Expand Down

0 comments on commit 3e8a324

Please sign in to comment.