(1) ES/SQL transmits interval values in a ISO8601 period value. An interval-to-period 1:1 mapping is possible, however ES/SQL doesn't adhere to this mapping. For instance:
instead of P1DT1H for INTERVAL '1 1' DAY TO HOUR, ES/SQL will send PT25H (which in a 1:1 mapping would be INTERVAL '25' HOUR literal, equivalent, but different from the original);
INTERVAL '61:59' MINUTE TO SECOND is encoded as PT1H1M59S instead of PT61M59S;
INTERVAL '61' SECOND is transmitted as PT1M1S vs. PT61S.
Because of this, the driver will now detect the mapping misalignment, convert any interval in the "day/to/second" range to seconds and re-calculate the values for the corresponding interval members from that.
(2) The interval types with a seconds component have the seconds precision as a property. With this PR the driver will read the Datetime(/Timestamp) scale and use that as precision for the interval with seconds component data type property, attached to the .precision field of the records.
This PR fixes two related issues:
(1) ES/SQL transmits interval values in a ISO8601 period value. An interval-to-period 1:1 mapping is possible, however ES/SQL doesn't adhere to this mapping. For instance:
P1DT1H
forINTERVAL '1 1' DAY TO HOUR
, ES/SQL will sendPT25H
(which in a 1:1 mapping would beINTERVAL '25' HOUR
literal, equivalent, but different from the original);INTERVAL '61:59' MINUTE TO SECOND
is encoded asPT1H1M59S
instead ofPT61M59S
;INTERVAL '61' SECOND
is transmitted asPT1M1S
vs.PT61S
.Because of this, the driver will now detect the mapping misalignment, convert any interval in the "day/to/second" range to seconds and re-calculate the values for the corresponding interval members from that.
(2) The interval types with a seconds component have the seconds precision as a property. With this PR the driver will read the Datetime(/Timestamp) scale and use that as precision for the interval with seconds component data type property, attached to the .precision field of the records.