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

Cannot read a fixed-length without line-ending. [BATCH-2538] #1064

Open
spring-projects-issues opened this issue Sep 30, 2016 · 13 comments · May be fixed by #3712
Open

Cannot read a fixed-length without line-ending. [BATCH-2538] #1064

spring-projects-issues opened this issue Sep 30, 2016 · 13 comments · May be fixed by #3712
Labels
in: infrastructure status: ideal-for-contribution Issues that are ideal for contribution by the community status: waiting-for-triage Issues that we did not analyse yet type: feature

Comments

@spring-projects-issues
Copy link
Collaborator

Kiichi Kuramoto opened BATCH-2538 and commented

FlatFileItemReader can not read a fixed-length file without line-ending, because it call BufferedReader#readline() at reading a record.
In general, a fixed-length file is often a line-ending not exist.
I would like to add new BufferedReader implementation for reading fixed-length file without line-ending (by specifying fixed-length size).


Affects: 3.0.7

2 votes, 10 watchers

@spring-projects-issues
Copy link
Collaborator Author

Aaron Patula commented

I'm a new contributor and would like to work on this issue.

@spring-projects-issues
Copy link
Collaborator Author

Mahmoud Ben Hassine commented

In general, a fixed-length file is often a line-ending not exist.

I'm not sure I understand this, do you mean the whole file is on a single line? Can you attach an example please?

@spring-projects-issues
Copy link
Collaborator Author

Mahmoud Ben Hassine commented

Any update on this?

@spring-projects-issues
Copy link
Collaborator Author

Hironobu Takahashi commented

do you mean the whole file is on a single line?

Yes. Examples are shown below.
(1 character = 1 byte)

Fixed-length file (Delimiter between records is number of bytes. 32 bytes = 1 record)

Sale012016 1   00000011000000000Sale022017 2   00000022000000000Sale032018 3   00000033000000000

@fmbenhassine
Copy link
Contributor

fmbenhassine commented Feb 19, 2020

Thanks for your update. Indeed, this type of files can be read using a custom BufferedReader. You are welcome to contribute if you want. You can get inspiration from the BinaryBufferedReader provided by Spring Batch or the FixedLengthBufferedReader from this example repo.

@fmbenhassine fmbenhassine added status: ideal-for-contribution Issues that are ideal for contribution by the community type: feature and removed type: enhancement labels Feb 19, 2020
@parikshitdutta
Copy link
Contributor

Hi @benas, can I look into this?

@fmbenhassine
Copy link
Contributor

@parikshitdutta Sure! Anything without a PR is open for contribution, no need to ask. Thank you for all your contributions!

@parikshitdutta
Copy link
Contributor

parikshitdutta commented May 12, 2020

Hi @benas, I am thinking to expose FixedLengthBufferedReader through a factory, say FixedLengthBufferedReaderFactory. Do you see I am overdoing or that could lead to redundancy?

I see setter for few readers that accept BufferedReaderFactory as argument, with lambda things are different, without that having factory would be easy to inject and satisfy respective setters.

Your thought?

@parikshitdutta
Copy link
Contributor

Please review the PR #3712, I will look forward to your feedback.

@fmbenhassine
Copy link
Contributor

fmbenhassine commented May 13, 2020

@parikshitdutta Thank you for your PR. To answer your question, I need to dig in in more details. However, this issue is not in our roadmap for now, we are focusing on the upcoming v4.3. I will let you know when we assign this issue to a release and start working on it. Thank you.

@parikshitdutta
Copy link
Contributor

Hi @benas,
Now that we are moving into 5.x releases, just wanted to check with you and @mminella, if this can be useful feature for upcoming 5.x releases.

Thank you.

@fmbenhassine
Copy link
Contributor

@parikshitdutta This is not critical, it could be addressed with a custom buffered reader as shown previously. Now adding this buffered reader as a built-in component in Spring Batch can be done in a minor version of the v5 line (5.1, 5.2, etc). For 5.0, we will be focusing on big changes that were not possible to introduce in minor versions of v4. We are currently working on our future release planning, so I will update this issue once it is assigned to a milestone. I just linked your PR to this issue.

@parikshitdutta
Copy link
Contributor

Thanks @benas for detailed information, and linking the PR to respective issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: infrastructure status: ideal-for-contribution Issues that are ideal for contribution by the community status: waiting-for-triage Issues that we did not analyse yet type: feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants