Giter Club home page Giter Club logo

Comments (10)

davidw76 avatar davidw76 commented on July 19, 2024 1

That sounds good. I will take a look at doing it that way.

from spark-excel.

nightscape avatar nightscape commented on July 19, 2024

Another option would be to add a virtual rowNumber column to the exported DataFrame and implement PrunedFilteredScan in addition to PrunedScan in ExcelRelation.
Then you could do something like

val preview = existingExcelDf.where(col("rowNumber") >= 5 && col("rowNumber") <= 1005)

What I'm not sure about though is if you to have to handle all filters (meaning Spark will not do any post-filtering) when you implement PrunedFilteredScan.

from spark-excel.

nightscape avatar nightscape commented on July 19, 2024

Ok, actually reading the documentation link I posted would have answered my question 😜
Spark will still do post-filtering, so it's OK to return false positives.
What do you think of implementing PrunedFilteredScan then and using that to do the start and end row logic?

from spark-excel.

jaceklaskowski avatar jaceklaskowski commented on July 19, 2024

Is anyone working on it? My project would benefit from such a feature a lot.

from spark-excel.

nightscape avatar nightscape commented on July 19, 2024

Just iterating over all issues again. Having this implemented should also fix #59.
@davidw76 @jaceklaskowski are you still interested in this?

from spark-excel.

davidw76 avatar davidw76 commented on July 19, 2024

Yes, for us it's more important to be able to ingest the first n rows, but for others I guess skipping n rows is more useful. So it would be good to be able to specify a range.

from spark-excel.

nightscape avatar nightscape commented on July 19, 2024

What I'm wondering is if we should handle the "skipping n rows because the header row is in line n+1" separately (see #65)?
Then the proposed solution with the artificial row_number column would still work and would allow additional features like

  • returning the first 100 and the last 100 rows (the end of the file might be interesting, too)
  • getting a column that uniquely identifies each row for free

OTOH, if all the majority of users need is a start and an end row then it would be overkill...

from spark-excel.

nightscape avatar nightscape commented on July 19, 2024

I just released 0.11.0. Please have a look at the corresponding CHANGELOG and the README about the new dataAddress option which supersedes sheetName, startColumn, endColumn and skipFirstRows and should hopefully cover this use-case as well.

from spark-excel.

santhoshdesikachari avatar santhoshdesikachari commented on July 19, 2024

@nightscape - I do not see skipFirstRows as one of the ExcelOptions. Do we have the feature of skipping initial rows in the excel before we start reading the header columns? Please let me know and I am in urgent need.

from spark-excel.

nightscape avatar nightscape commented on July 19, 2024

Check out dataAddress

from spark-excel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.