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

Script: ulong via fields API #76519

Merged
merged 16 commits into from
Aug 17, 2021

Commits on Aug 13, 2021

  1. Script: ulong via fields API

    Exposes unsigned long via the fields API.
    
    Unsigned longs default to java signed longs.  That means the upper range
    appears negative.  Consumers should use `Long.compareUnsigned(long, long)`
    `Long.divideUnsigned(long, long)` and `Long.remainderUnsigned(long, long)`
    to correctly work with values known to be unsigned long.
    
    Alternatively, users may treat the unsigned long type as `BigInteger` using
    the field API, `field('ul').as(Field.BigInteger).getValue(BigInteger.ZERO)`.
    ```
    field('ul').as(Field.BigInteger).getValue(BigInteger.valueOf(1000))
    field('ul').getValue(1000L)
    ```
    
    This change also implements the beginning of the converters for the fields
    API.  The following conversions have been added:
    ```
    ulong <-> BigInteger
    long <-> BigInteger
    double -> BigInteger
    String (parsed as long or double) -> BigInteger
    double -> long
    String (parsed as long or double) -> long
    Date (epoch milliseconds) -> long
    Nano Date (epoch nanoseconds) -> long
    boolean (1L for true, 0L for false) -> long
    ```
    
    Fixes: elastic#64361
    stu-elastic committed Aug 13, 2021
    Configuration menu
    Copy the full SHA
    e8663a9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f3f5700 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7adc6d4 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2021

  1. javadoc

    stu-elastic committed Aug 16, 2021
    Configuration menu
    Copy the full SHA
    60ebf61 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5155e51 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    29dad53 View commit details
    Browse the repository at this point in the history
  4. doc['ul'].value syntax

    stu-elastic committed Aug 16, 2021
    Configuration menu
    Copy the full SHA
    4904abc View commit details
    Browse the repository at this point in the history
  5. remove date tests

    stu-elastic committed Aug 16, 2021
    Configuration menu
    Copy the full SHA
    aa52c00 View commit details
    Browse the repository at this point in the history
  6. date milli and nano tests

    stu-elastic committed Aug 16, 2021
    Configuration menu
    Copy the full SHA
    2b1dc8a View commit details
    Browse the repository at this point in the history
  7. remove unused TimeUnit

    stu-elastic committed Aug 16, 2021
    Configuration menu
    Copy the full SHA
    69ec48d View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2021

  1. Configuration menu
    Copy the full SHA
    b5a2965 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aef03a1 View commit details
    Browse the repository at this point in the history
  3. pr comments

    stu-elastic committed Aug 17, 2021
    Configuration menu
    Copy the full SHA
    e60fe36 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5d82d1a View commit details
    Browse the repository at this point in the history
  5. unused import

    stu-elastic committed Aug 17, 2021
    Configuration menu
    Copy the full SHA
    5153221 View commit details
    Browse the repository at this point in the history
  6. format

    stu-elastic committed Aug 17, 2021
    Configuration menu
    Copy the full SHA
    369e58b View commit details
    Browse the repository at this point in the history