You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cobolSchema.extractPrimitiveField(lengthAST, binaryDataStart, readerProperties.startOffset) match {
154
-
casei: Int=> i
155
-
casel: Long=> l.toInt
156
-
cases: String=> s.toInt
157
-
casenull=>thrownewIllegalStateException(s"Null encountered as a record length field (offset: $byteIndex, raw value: ${getBytesAsHexString(binaryDataStart)}).")
158
-
case _ =>thrownewIllegalStateException(s"Record length value of the field ${lengthAST.name} must be an integral type.")
159
-
}
160
-
} else {
161
-
cobolSchema.extractPrimitiveField(lengthAST, binaryDataStart, readerProperties.startOffset) match {
casenull=>thrownewIllegalStateException(s"Null encountered as a record length field (offset: $byteIndex, raw value: ${getBytesAsHexString(binaryDataStart)}).")
166
-
case _ =>thrownewIllegalStateException(s"Record length value of the field ${lengthAST.name} must be an integral type.")
case _ =>thrownewIllegalStateException(s"Record length value of the field ${field.name} must be an integral type.")
204
-
}
205
-
} catch {
206
-
caseex: NumberFormatException=>
207
-
thrownewIllegalStateException(s"Encountered an invalid value of the record length field. Cannot parse '$obj' as an integer in: ${field.name} = '$obj'.", ex)
Copy file name to clipboardExpand all lines: spark-cobol/src/test/scala/za/co/absa/cobrix/spark/cobol/source/integration/Test37RecordLengthMappingSpec.scala
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,26 @@ class Test37RecordLengthMappingSpec extends AnyWordSpec with SparkTestBase with
Copy file name to clipboardExpand all lines: spark-cobol/src/test/scala/za/co/absa/cobrix/spark/cobol/source/regression/Test26FixLengthWithIdGeneration.scala
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ class Test26FixLengthWithIdGeneration extends AnyWordSpec with SparkTestBase wit
0 commit comments