Git Product home page Git Product logo

Comments (1)

Fokko avatar Fokko commented on July 17, 2024

Thanks for raising this @snazy. Digging into it:

➜  orc git:(main) grep -R "floorDiv" . | grep -v "Test"
./java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java:      long longValue = Math.floorDiv(millis, 1000);
./java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java:      double result = Math.floorDiv(ts.getTime(), 1000);
./java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java:      long seconds = Math.floorDiv(timestampColVector.time[elementNum], 1000);
./java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java:    return Instant.ofEpochSecond(Math.floorDiv(vector.time[element], 1000),
➜  orc git:(main) grep -R "floorMod" . | grep -v "Test"
./java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java:            (int) Math.floorMod(millis, 1000) * 1_000_000;
./java/core/src/java/org/apache/orc/impl/StringHashTableDictionary.java:    return Math.floorMod(hash, capacity);

Looking at the code, it has been in there for 5 years, introduced in ORC-578: https://github.com/apache/orc/blame/517776f3e7f8745c365cc0fc69d7cabbdc34d714/java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java#L627

What's happening here is that the compiler applies implicit cast type from int ➜ long before passing it in floorMod(long, long). The ORC 1.x branch is tested against Java 8, and the new 2.x release is Java 17+, so I think we're good here.

from iceberg.

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.