Stephen WithersGuest
Can you please tell me what values are used for null for the various datatypes when calling from c.java?
A special NULL function can be used to create kdb “null” values in the java api:
Kdb+ type |
Kdb+ null accessor |
Java null
|
Boolean |
NULL(‘b’) |
Boolean(false)
|
Byte |
NULL(‘x’) |
Byte(byte() 0)
|
Short |
NULL(‘h’) |
Short(Short.MIN_VALUE)
|
Integer |
NULL(‘i’) |
Integer(Integer.MIN_VALUE)
|
Long |
NULL(‘j’) |
Long(Long.MIN_VALUE)
|
Float |
NULL(‘e’) |
Float(Double.NaN)
|
Double |
NULL(‘f’) |
Double(Double.Nan)
|
Character |
NULL(‘c’) |
Character(‘ ‘)
|
String |
NULL(‘s’) |
“”
|
Month |
NULL(‘m’) |
Month(Integer.MIN_VALUE)
|
Date |
NULL(‘d’) |
Date(Integer.MIN_VALUE)
|
DataTime/java.util.Date |
NULL(‘z’) |
Timestamp(Long.MIN_VALUE)
|
Minute |
NULL(‘u’) |
Minute(Integer.MIN_VALUE)
|
Second |
NULL(‘v’) |
Second(Integer.MIN_VALUE)
|
Time |
NULL(‘t’) |
Time(Integer.MIN_VALUE)
|
Source: http://code.kx.com/wiki/Cookbook/InterfacingWithJava#Creating_null_values