Giter Club home page Giter Club logo

Comments (7)

jameslamb avatar jameslamb commented on May 18, 2024

Thanks for opening this up @jvondollen . I have one followup question...what type of aggs are using?

Each aggregation result has a slightly different format, so if you can provide that it would help us narrow down the issue.

The fact that you got log_fatal means that this is an error we intended to throw, so we may also need to revisit why unpack_nested_data breaks with an empty column instead of warning and returning NULL.

cc @wdearden @austin3dickey

from uptasticsearch.

jvondollen avatar jvondollen commented on May 18, 2024

This involves some multilevel nested sums aggregated over different terms. It also involves a reverse_nested aggregation. I'm not sure what exactly you men by "type" of aggs, but the query structure is something of the form:

aggs
  nested
    aggs
       nested
          aggs
             terms
                aggs
                   reverse_nested
                     aggs
                        sum

from uptasticsearch.

jameslamb avatar jameslamb commented on May 18, 2024

Oh sorry. By type I mean e.g. stats, terms, extended_stats, etc.

Also I'm sure that we don't have a test for reverse_nested, so that is something we will have to explore.

One other question...what version of ES are you on? We test uptasticsearch against all major versions going back to 1.0, but having the version number will help us to nail down where we need to look for additional documentation on Elastic's site.

from uptasticsearch.

jvondollen avatar jvondollen commented on May 18, 2024

Ah, this makes sense since most of my aggregations involve reverse_nested ( stats and terms).
I'm currently using ES version 5.6.9

from uptasticsearch.

jameslamb avatar jameslamb commented on May 18, 2024

Ok cool, that helps!

@jvondollen and I talked over email and it revealed something valuable. Sounds like his query was returning 0 results, and the error he got was because of that.

I propose that in that situation, it would be more natural to throw a warning and return an empty data.table. I think that's more natural. Like imagine the case where you're running some pipeline like this:

resultList <- lapply(vector_of_stuff, function(thing){
    es_search("myhost.com:9200", "my_index", sprintf(query_template, thing))
})
resultDT <- data.table::rbindlist(
    resultList
    , fill = TRUE
)

It would be real annoying if you had 100 queries and couldn't get your result because one of them returned no results.

I prefer an empty data.table to a straight-up NULL because it will also prevent code that expects one data.table from breaking.

This thread revealed another problem...we have no tests for reverse_nested aggregations! So thanks to you @jvondollen for exposing a couple of weaknesses in the package!

from uptasticsearch.

jameslamb avatar jameslamb commented on May 18, 2024

To close this issue:

  1. Change aggs handling code to warn and return data.table::data.table() on a null result
  2. Add test confirming that empty results from aggs queries return that empty data.table and throw a warning

from uptasticsearch.

jameslamb avatar jameslamb commented on May 18, 2024

Going to close this one, as I think it is addressed by the changes in #70

#59 is still open and we don't currently have support for reverse-nested stuff. @jvondollen if you have the time we'd love your help in addressing that issue! I'm not really familiar with reverse_nested stuff.

from uptasticsearch.

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.