AbsaOSS / cobrix

A COBOL parser and Mainframe/EBCDIC data source for Apache Spark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Leveraging copybookparser in java

codealways opened this issue · comments

I want to use below copybookparser for retrieving sparksql schemas in java.

val parsedSchema = CopybookParser.parseTree(copyBookContents)

in Java its expecting all the parameters for parseTree function. Please let me know how to resolve it using java code

New versions of Cobrix have CopybookParser.parse() method. Try using it. The only mandatory parameter is cookbook content.

We tried with V2.1.0, but still its expecting all the parameters.

I can implement something line parseSimple() that would require parameters that affect only copybook format and AST structure. Could I ask you to post the piece of code you use to parse a copybook now? I want to double-check the values that you pass.

I am just trying to provide only copybook content as the parameter so that i can get the parsed schema.

Will add parseSimple() that will require just a couple of arguments that are copybook and AST-related.

Thanks sure.

Its already released but didnt find it in Maven. Is it going to deploy to maven once the pr #321 is approved and merged.

It's already deployed. We merge release PRs when we see the artifact on Maven Central.
It is there already: https://search.maven.org/artifact/za.co.absa.cobrix/spark-cobol_2.11/2.1.1/jar

its my bad, there was a typo on my end while i procure it in our space.