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

PIC 9(11)v9(02) fields converting full of spaces into 0.00 #501

Closed
Loganhex2021 opened this issue May 18, 2022 · 1 comment
Closed

PIC 9(11)v9(02) fields converting full of spaces into 0.00 #501

Loganhex2021 opened this issue May 18, 2022 · 1 comment
Assignees
Labels
accepted Accepted for implementation bug Something isn't working

Comments

@Loganhex2021
Copy link

Describe the bug

The hex value in the source file is 40404040404040404040404040, which is full of zeroes. But while reading the file , the spaces converted into 0.00. We are expecting null here.

Code snippet that caused the issue

  spark.read
   .format("cobol")

Expected behavior

A clear and concise description of what you expected to happen.

Context

  • Cobrix version:
  • Spark version:
  • Scala version:
  • Operating system:

Copybook (if possible)

         01  RECORD.
           05  FIELD1    PIC 9(11)V9(02).

Attach a small data file that can help reproduce the issue, if possible.

Read_options:
{'encoding': 'EBCDIC', 'ebcdic_code_page': 'cp037', 'string_trimming_policy': 'none', 'debug_ignore_file_size': 'true'}

@yruslan , Could you please guide us to fix this issue

@Loganhex2021 Loganhex2021 added the bug Something isn't working label May 18, 2022
@yruslan yruslan added the accepted Accepted for implementation label May 19, 2022
@yruslan yruslan self-assigned this May 19, 2022
@yruslan
Copy link
Collaborator

yruslan commented May 19, 2022

There is an option ('improved_null_detection') that improves the behavior of null detection. Since it is a breaking change it is turned off by default. But even when it is turned on the issue you specified takes place. Will fix.

In 2.5.0 the option will be turned on by default.

@yruslan yruslan closed this as completed Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Accepted for implementation bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants