Giter VIP home page Giter VIP logo

Comments (4)

ZJONSSON avatar ZJONSSON commented on September 10, 2024

Thanks @girishgoudapatil. What elasticsearch client version / server version are you using? Are you using etl.collect above to assemble bulks above the etl.elastic.index? Can you verify that the data is actually uploaded to ElasticSearch?

Here is the corresponding test:
https://github.com/ZJONSSON/node-etl/blob/master/test/elastic-test.js#L31-L43

 it('pipes data into elasticsearch',function() {
    var i = 0;
    var upsert = etl.elastic.index(client,'test','test',{pushResult:true});

    return data.stream()
      .pipe(etl.map(function(d) {
        d._id = i++;
        return d;
      }))
      .pipe(etl.collect(100))
      .pipe(upsert)
      .promise()
      .then(function(d) {
        assert.equal(d[0].items.length,3);
        assert.deepEqual(d[0].items[0].body,data.data[0]);
      });
  });

https://circleci.com/gh/ZJONSSON/node-etl/138

  elastic bulk insert
    ✓ pipes data into elasticsearch (746ms)
    ✓ retrieves data back from elasticsearch (2036ms)
    ✓ streams results with elastic.find
    ✓ streams results with elastic.scroll (608ms)

from node-etl.

patilgirish avatar patilgirish commented on September 10, 2024

@ZJONSSON thanks for the quick response.

I am using [email protected] module , below code returns empty dataset for me in the resolve.

  .pipe(etl.collect(500))
  .pipe(etl.elastic.index(esClient,index,'test', {
    concurrency : 5,
    pushResult : true,
    pushErrors : true
  }))
  .promise()
  .then(function (data) {
    console.log(data);
    return upload(tmpFilename, s3key);
  })

actually pushing everything in one go under resolve would be memory intensive if you are processing millions of records

from node-etl.

ZJONSSON avatar ZJONSSON commented on September 10, 2024

Ah I spotted the culprit. pushErrors currently supersedes pushResult (see here) - meaning that if you elect pushErrors then pushResults is ignored (you receive nothing downstream unless records errored). I think this should probably be the other way around to eliminate confusion - will post a patch.

Your code should work if you simply remove pushErrors from the options in your original example. (pushResults pushes both successes and errors). Let me know if that works

from node-etl.

ZJONSSON avatar ZJONSSON commented on September 10, 2024

See #46 - please reopen if the issue persists
(published on npm as [email protected])

from node-etl.

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.