Giter Club home page Giter Club logo

Comments (1)

yruslan avatar yruslan commented on May 27, 2024

Cobrix tries to retain the original COBOL schema when reading copybook+data file. That's why all the root level fields are struct types. You can use .option("schema_retention_policy", "collapse_root") to expand the root level of the schema. If you need a completely flat schema you can use SparkUtils.flattenSchema() function.

If you want to retain the structured nature of the data the better way to look at it is by exporting to json. Something like df.toJSON.take(10).foreach(println)

The error message is likely related to the fact the the record length does not divide the size of the binary file. Internally Cobrix uses Spark's binaryRecords() method. It requires that the total size of the file(s) be evenly divided by record size. The record size is available from the logs (the layout positions part).

Usually this error means that the copybook doesn't match the data. For instance, the copybook has missing fields. You can verify this by carefully comparing first several records reported by Spark against values shown in the mainframe.

from cobrix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.