node-hbase icon indicating copy to clipboard operation
node-hbase copied to clipboard

Update scanner.js

Open mosfet1kg opened this issue 8 years ago • 6 comments

fixes parameter

mosfet1kg avatar Jul 28 '17 07:07 mosfet1kg

Could you provide more explanation, what's wrong with the current implementation, if params.batch is undefined or null, it default to "1000" ?

wdavidw avatar Jul 28 '17 10:07 wdavidw

I saw batch option at this page. However, it seems that the parameters that finally be sent to server do not include the batch option.

mosfet1kg avatar Jul 28 '17 15:07 mosfet1kg

Not sure how your pull request could fix anything, please send me an associated test case illustrating the issue

wdavidw avatar Jul 28 '17 18:07 wdavidw

https://github.com/adaltas/node-hbase/blob/ba72f40d8d58893493d308d3324ff0ad2740a2e5/lib/scanner.js#L33

  params = {};
  if (params.batch == null) {
    params.batch = 1000;
  }

Without a test case, I think I can fully explain. Because params object does not nave batch property, IF statement doesn't mean anything. In addition, this.options variable contains attributes for scanner. If you allow users to use batch attribute, I think this value should be imported from here.

mosfet1kg avatar Sep 02 '17 12:09 mosfet1kg

https://github.com/adaltas/node-hbase/blob/ba72f40d8d58893493d308d3324ff0ad2740a2e5/lib/scanner.js#L129

I don't trust this function because it sometimes behaves oddly. Therefore, I could not help but implement a logic to get all of record from hbase. At this case, the batch s parameter is very important option.

I would like to say the problem of that function, but I wouldn't comment on it if you might know.

mosfet1kg avatar Sep 02 '17 12:09 mosfet1kg

@wdavidw Can we close this PR ?

IDerr avatar Mar 13 '19 05:03 IDerr