You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by Istvan Toth <st...@apache.org> on 2021/11/12 08:28:18 UTC

[DISCUSS] Serializing extra data into expressions in a backwards-compatible way

Hi!

I am working on PHOENIX-5066 (JDBC compliant Timezone Handling).
After some false starts, now I believe that the best way to solve this
includes serializing the client timezone (and date format string) into the
expressions sent to the RSs.

However, the way serialization is handled is not really extendable in a
backwards-compatible way.

There are some examples of adding fields in ToDateFunction and
LiteralExpression, both of which are very hacky. I can probably shoehorn in
additional options by further complicating those schemes.

However, in some cases, like DayOfWeekFunction, the current implementation
does not serialize any additional input now, and I cannot see how I could
add the additional information without breaking old clients.

So far the only solution that I could come up with is duplicating these
functions with new names i.e DAYOFWEEK2, overriding write() and
readFields(), and using those from the new clients, but it is not a very
clean solution either.

I could probably also do some rewriting and fake some parameters (children)
to those functions, but that sounds even worse.

What do you think ?
Is duplicating the function NAMES an acceptable solution ?
Can you suggest a better way ?

Istvan