Skip to main content

Jython evaluator converts fields with null to STRING.

  • February 19, 2022
  • 1 reply
  • 96 views

AkshayJadhav
StreamSets Employee
Forum|alt.badge.img

Issue:

The Jython evaluator converts fields with null to STRING, regardless of the columns type.

 

Solution:

In the scripting processors, if a user needs to specify the data type of a field, which contains NULL, the user needs to use following constants (please find commented list also in the script of each scripting processor):

 # Available constants: 

#  They are to assign a type to a field with a value null.

#  NULL_BOOLEAN, NULL_CHAR, NULL_BYTE, NULL_SHORT, NULL_INTEGER, NULL_LONG

#  NULL_FLOATNULL_DOUBLE, NULL_DATE, NULL_DATETIME, NULL_TIME, NULL_DECIMAL

#  NULL_BYTE_ARRAY, NULL_STRING, NULL_LIST, NULL_MAP


Otherwise, if the processor returns null, the filed data format is of STRING type.

 

Did this topic help you find an answer to your question?

1 reply

  • Fan
  • 2 replies
  • April 5, 2023
AkshayJadhav wrote:

Issue:

The Jython evaluator converts fields with null to STRING, regardless of the columns type.

 

Solution:

In the scripting processors, if a user needs to specify the data type of a field, which contains NULL, the user needs to use following constants (please find commented list also in the script of each scripting processor):

 # Available constants: 

#  They are to assign a type to a field with a value null.

#  NULL_BOOLEAN, NULL_CHAR, NULL_BYTE, NULL_SHORT, NULL_INTEGER, NULL_LONG

#  NULL_FLOATNULL_DOUBLE, NULL_DATE, NULL_DATETIME, NULL_TIME, NULL_DECIMAL

#  NULL_BYTE_ARRAY, NULL_STRING, NULL_LIST, NULL_MAP


Otherwise, if the processor returns null, the filed data format is of STRING type.

 

Can you provide and example here if there is null integer field.


Reply