Skip to content

Commit

Permalink
Avoid intermediate copy of table for TableTraits sources (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff authored and quinnj committed Feb 22, 2019
1 parent e4c94b7 commit 950bf4b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/datavalues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ DataValueRowIterator(::Type{NT}, x::S) where {NT <: NamedTuple, S} = DataValueRo
DataValueRowIterator(::Type{Schema{names, types}}, x::S) where {names, types, S} = DataValueRowIterator{datavaluetype(NamedTuple{names, types}), S}(x)

function datavaluerows(x)
r = Tables.rowtable(x)
return DataValueRowIterator(datavaluetype(Tables.schema(r)), r)
r = Tables.rows(x)
s = Tables.schema(r)
s === nothing && error("Schemaless sources cannot be passed to datavaluerows.")
return DataValueRowIterator(datavaluetype(s), r)
end

_iteratorsize(x) = x
Expand Down

0 comments on commit 950bf4b

Please sign in to comment.