Skip to content

Clarify error message when a copybook is not specified #293

@yruslan

Description

@yruslan

Describe the bug

Currently, if neither a copybook nor copybook contents are specified, spark-cobol will fail with the following error message:

Exception in thread "main" java.lang.IllegalStateException: Cannot define path to source files: missing parameter: 'path'
	at za.co.absa.cobrix.spark.cobol.source.parameters.CobolParametersValidator$.validateOrThrow(CobolParametersValidator.scala:97)
	at za.co.absa.cobrix.spark.cobol.source.DefaultSource.createRelation(DefaultSource.scala:52)
	at za.co.absa.cobrix.spark.cobol.source.DefaultSource.createRelation(DefaultSource.scala:48)
	at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:318)

To Reproduce

    val df = spark
      .read
      .format("cobol")
      .load("/path/file")

Expected behaviour

The error message should say clearly that a copybook is missing.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions