Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow LogicalColumnReader to be IEnumerable<T> #16

Closed
GPSnoopy opened this issue Sep 5, 2018 · 4 comments
Closed

Allow LogicalColumnReader to be IEnumerable<T> #16

GPSnoopy opened this issue Sep 5, 2018 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@GPSnoopy
Copy link
Contributor

GPSnoopy commented Sep 5, 2018

Feature requested by user.

Currently they have to write it themselves. Not sure if we want to provide this or not (i.e. whether it's going beyond the scope of this library).

@GPSnoopy GPSnoopy added the enhancement New feature or request label Sep 5, 2018
@GPSnoopy GPSnoopy self-assigned this Sep 5, 2018
@GPSnoopy
Copy link
Contributor Author

GPSnoopy commented Sep 5, 2018

I'd favour a method that returns an IEnumerable from a LogicalColumnReader rather than making the reader IEnumerable.

@GPSnoopy
Copy link
Contributor Author

GPSnoopy commented Sep 5, 2018

foreach (var value in rowGroupReader.Column(c).LogicalReader().Enumerate())
{
    /* ... */
}

@herebebeasties
Copy link

I'd probably name that AsEnumerable() as opposed to Enumerate() to be more idiomatic.

But TBH I'm not sure why you'd bother returning a separate IEnumerable<T> like that, instead of just making LogicalColumnReader implement it. What's the reasoning there? You're already going to need to make an IEnumerator<T> which does the right thing, so why would you favour adding another layer?

@GPSnoopy
Copy link
Contributor Author

This should be fixed in 1.4.0.2-beta3. @herebebeasties argument swayed me in favour of implementing IEnumerable<T> directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants