Details
-
Bug
-
Status: Resolved
-
P2
-
Resolution: Fixed
-
None
Description
schema.logicaltypes.FixedBytes logical type expects an argument - the length of the byte[].
When an invalid input value (with length < expectedLength) is provided while building the Row with FixedBytes logical type, IllegalArgumentException is expected. But, the Exception is not thrown. The below code illustrates the behaviour:
Schema schema = Schema.builder().addLogicalTypeField("char", FixedBytes.of(10)).build(); byte[] byteArray = {1, 2, 3, 4, 5}; Row row = Row.withSchema(schema).withFieldValue("char", byteArray).build(); System.out.println(Arrays.toString(row.getLogicalTypeValue("char", byte[].class)));
The above code prints "[1, 2, 3, 4, 5]" with length 5 to the console, whereas the expected length of FixedBytes, is 10.
The code is run on the master branch.
The behaviour is as expected with 2.20.0 release.
Attachments
Issue Links
- links to