partiql / partiql-lang-kotlin

PartiQL libraries and tools in Kotlin.
https://partiql.org/
Apache License 2.0
538 stars 60 forks source link

`PartiQLValueTextWriter` currently does not implement printing datetime values #1491

Closed alancai98 closed 3 months ago

alancai98 commented 3 months ago

Description

PartiQLValueTextWriter does not print datetime values. Currently it does not implement the writer for datetime values, so attempting to print out a datetime value will result in an IllegalArgumentException.

This is also pointed out in the tests:

https://github.com/partiql/partiql-lang-kotlin/blob/68e4849b152debc3bf5964c9dccd0082d80ed26e/partiql-types/src/test/kotlin/org/partiql/value/io/PartiQLValueTextWriterTest.kt#L39-L40.

To Reproduce

Steps to reproduce the behavior:

  1. Call PartiQLValueTextWriter's append, which calls the ToString visitor with a datetime PartiQLValue
  2. Get an IllegalArgumentException -- Caused by: java.lang.IllegalArgumentException: Cannot write value of type DATE

Expected Behavior

Additional Context