Giter VIP home page Giter VIP logo

Comments (4)

Matthieu-LAURENT39 avatar Matthieu-LAURENT39 commented on June 10, 2024 1

Well, i found the issues.

The MAX function only works if it can cast the value to usize, otherwise it ignores the value, so that explains why fselect "MAX(modified) from /tmp/test" didn't work. I assume that's intended behavior.

The issue with fselect "MAX(YEAR(modified)) from /tmp/test" (as well as fselect "MIN(YEAR(modified)) from /home/user", which is an example from the docs) is that it will look for Year(Modified) in the hasmap from the raw_output_buffer, but that hasmap only contains the raw Modified and an empty Min(Year(Modified)).
That means a really simple workaround is to use this query: MIN(YEAR(modified)), YEAR(modified) from /tmp/test., which will make fselect compute the needed Year(Modified).

I tried fixing it myself, but i can't really understand the structure of the code, especially since it doesn't have many comments.

from fselect.

jhspetersson avatar jhspetersson commented on June 10, 2024 1

from fselect.

jhspetersson avatar jhspetersson commented on June 10, 2024

Thank you very much for this issue!

Indeed, the code is an undocumented mess... It appears, a deliberate "shortcut" has been made at some point, so the aggregates didn't work with the enclosed functions.

I added a small fix to the master branch. It would be great to check if it works for you now.

MIN and MAX for datetime fields is actually an another problem. Will add it soon, I guess :)

from fselect.

Matthieu-LAURENT39 avatar Matthieu-LAURENT39 commented on June 10, 2024

Works fine now!
About the lack of code comments, would you accept a PR that reformats / documents some of the code?

from fselect.

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.