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
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1517,6 +1517,7 @@ The output looks like this:
1517
1517
| .option("occurs_mapping", "{\"FIELD\": {\"X\": 1}}") | If specified, as a JSON string, allows for String `DEPENDING ON` fields with a corresponding mapping. |
1518
1518
| .option("strict_sign_overpunching", "true") | If `true` (default), sign overpunching will only be allowed for signed numbers. If `false`, overpunched positive sign will be allowed for unsigned numbers, but negative sign will result in null. |
1519
1519
| .option("improved_null_detection", "true") | If `true`(default), values that contain only 0x0 ror DISPLAY strings and numbers will be considered `null`s instead of empty strings. |
1520
+
| .option("strict_integral_precision", "true") | If `true`, Cobrix will not generate `short`/`integer`/`long` Spark data types, and always use `decimal(n)` with the exact precision that matches the copybook. |
1520
1521
| .option("binary_as_hex", "false") | By default fields that have `PIC X` and `USAGE COMP` are converted to `binary` Spark data type. If this option is set to `true`, such fields will be strings in HEX encoding. |
Copy file name to clipboardExpand all lines: cobol-parser/src/main/scala/za/co/absa/cobrix/cobol/parser/decoders/DecoderSelector.scala
+52-40Lines changed: 52 additions & 40 deletions
Original file line number
Diff line number
Diff line change
@@ -42,13 +42,15 @@ object DecoderSelector {
42
42
* <li> Integral types are represented as boxed integers and longs. Larger integral numbers are represented as BigDecimal </li>
43
43
* </ul>
44
44
*
45
-
* @paramdataType A daatype of a copybook field
46
-
* @paramstringTrimmingPolicy Specifies how the decoder should handle string types
47
-
* @paramebcdicCodePage Specifies a code page to use for EBCDIC to ASCII/Unicode conversion
48
-
* @paramasciiCharset A charset for ASCII encoded data
49
-
* @paramisUtf16BigEndian If true UTF-16 strings are considered big-endian.
50
-
* @paramfloatingPointFormat Specifies a floating point format (IBM or IEEE754)
51
-
* @paramstrictSignOverpunch if true, sign overpunching is not allowed for positive numbers.
45
+
* @paramdataType A datatype of a copybook field
46
+
* @paramstringTrimmingPolicy Specifies how the decoder should handle string types
47
+
* @paramebcdicCodePage Specifies a code page to use for EBCDIC to ASCII/Unicode conversion
48
+
* @paramasciiCharset A charset for ASCII encoded data
49
+
* @paramisUtf16BigEndian If true UTF-16 strings are considered big-endian.
50
+
* @paramfloatingPointFormat Specifies a floating point format (IBM or IEEE754)
51
+
* @paramstrictSignOverpunch if true, sign overpunching is not allowed for positive numbers.
52
+
* @paramimprovedNullDetection If true, string values that contain only zero bytes (0x0) will be considered null.
53
+
* @paramstrictIntegralPrecision If true, Cobrix will not generate short/integer/long Spark data types, and always use decimal(n) with the exact precision that matches the copybook.
52
54
* @return A function that converts an array of bytes to the target data type.
thrownewIllegalStateException(s"Unknown number compression format (${integralType.compact.get}).")
241
250
}
242
251
}
243
252
244
253
/** Gets a decoder function for a binary encoded integral data type. A direct conversion from array of bytes to the target type is used where possible. */
/** Gets a decoder function for a BCD-encoded integral data type. A direct conversion from array of bytes to the target type is used where possible. */
0 commit comments