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

Copybook path in jar path #748

Open
theonebeyond opened this issue Feb 25, 2025 · 1 comment
Open

Copybook path in jar path #748

theonebeyond opened this issue Feb 25, 2025 · 1 comment
Assignees
Labels
accepted Accepted for implementation enhancement New feature or request question Further information is requested

Comments

@theonebeyond
Copy link

Background [Optional]

I am using spark submit to execute a spark program, and I'm passing the copybook path as a parameter, the path I intent to use is the relative path in my jar package resource. After testing only file system path(either file:/// or hdfs://) are accepted

Question

Does Cobrix support jar path, I want to bring in the copybook packed in my jar. Say /copybook/mybook

@theonebeyond theonebeyond added the question Further information is requested label Feb 25, 2025
@yruslan
Copy link
Collaborator

yruslan commented Feb 27, 2025

In Cobrix you can't specify the path in the jar. But this is interesting, we can implement it.

In the meantime, you can use a workaround:

import org.apache.commons.io.IOUtils

val copybookContents = IOUtils.toString(getClass.getResourceAsStream("/copybook/mybook"), "UTF-8")

val df = spark.read.format("cobol").option("copybook_contents", copybookContents).load("s3://mybucket/myfile")

@yruslan yruslan added enhancement New feature or request accepted Accepted for implementation labels Feb 27, 2025
@yruslan yruslan self-assigned this Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Accepted for implementation enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants