HasNullTrue.yqls 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. (
  2. (let config (DataSource 'config))
  3. (let res_sink (DataSink 'result))
  4. # Optional
  5. (let value (Nothing (OptionalType (DataType 'Int32))))
  6. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  7. (let value (Just (Nothing (OptionalType (DataType 'Int32)))))
  8. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  9. # Null
  10. (let value (Null))
  11. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  12. (let value (Just (Null)))
  13. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  14. (let value (Nothing (OptionalType (NullType))))
  15. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  16. (let value (Just (Nothing (OptionalType (NullType)))))
  17. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  18. # Tuple
  19. (let value '((Int32 '1) (String 'test) (Nothing (OptionalType (DataType 'Int32)))))
  20. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  21. # Struct
  22. (let value (AsStruct '('a (Int32 '1)) '('b (Just (Nothing (OptionalType (DataType 'Int32)))))))
  23. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  24. # Variant
  25. (let valueType (VariantType (TupleType (DataType 'Int32) (NullType))))
  26. (let value (Variant (Null) '1 valueType))
  27. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  28. (let valueType (VariantType (StructType '('a (DataType 'Int32)) '('b (OptionalType (DataType 'String))))))
  29. (let value (Variant (Nothing (OptionalType (DataType 'String))) 'b valueType))
  30. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  31. # List
  32. (let value (AsList (Null) (Int32 '1) (Int32 '2)))
  33. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  34. (let value (AsList (Int32 '1) (Int32 '2) (Null)))
  35. (let world (Write! world res_sink (Key) (HasNull value) '('('type))))
  36. (let world (Commit! world res_sink))
  37. (return world)
  38. )