Skip to main content
Solved

Why is featurereader reading way more records than are in the input?

  • August 18, 2023
  • 8 replies
  • 78 views

rmcgregor

Starting out with feature reader, and I am definitely missing something. The input dataset has about 1,600 records. Why is the output at 366,458 (and counting) about 10% of the way through?

Thank you,

image

Best answer by geomancer

Visualization of the three different possibilities I mentioned.

image

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

geomancer
Evangelist
Forum|alt.badge.img+58
  • Evangelist
  • 932 replies
  • August 18, 2023

Yeah, this is a common mistake...

As the documentation mentions, a complete read is done for each feature that enters the Initiator port. 

The Initiator exit port shows there are 218 initiating objects processed (so far), so every record in the input data set has been read 218 times (so far).

You should have only one feature enter the FeatureReader.


rmcgregor
  • Author
  • 24 replies
  • August 18, 2023

Thank you. Can you select for a single record in the input? ie 'uniqueid = 1'?


geomancer
Evangelist
Forum|alt.badge.img+58
  • Evangelist
  • 932 replies
  • August 18, 2023

You can use a Sampler, sampling only the first feature that enters.

Or you can place the FeatureReader after a Creator.

Or maybe (depending on the input source) you can replace the Creator and the FeatureReader with a SQLCreator.


geomancer
Evangelist
Forum|alt.badge.img+58
  • Evangelist
  • 932 replies
  • Best Answer
  • August 18, 2023

Visualization of the three different possibilities I mentioned.

image


rmcgregor
  • Author
  • 24 replies
  • August 18, 2023

Thank you. I appreciate it. Yes, it was reading each record 1681 times. A where clause that selected a single records seemed to work.


rmcgregor
  • Author
  • 24 replies
  • August 18, 2023

I've tried scenario one and the 'generic' output, which has the correct number of records, has no fields '<no schema>'


rmcgregor
  • Author
  • 24 replies
  • August 18, 2023

Sampler and specifying the output port seems to do the trick. I really appreciate your help.


geomancer
Evangelist
Forum|alt.badge.img+58
  • Evangelist
  • 932 replies
  • August 21, 2023

Sampler and specifying the output port seems to do the trick. I really appreciate your help.

Ah yes, I created a quick mockup for the visualization. You should indeed specify the output port.

I'm glad I could help you.