-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: disambiguate float,decimal formatting #28129
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jordanlewis
force-pushed
the
disambig-float-dec
branch
from
August 1, 2018 14:42
6f75f40
to
3a281e2
Compare
can you double check the failing logic tests and fix the handling of NaN, then I'll have another look |
jordanlewis
force-pushed
the
disambig-float-dec
branch
from
August 1, 2018 16:04
3a281e2
to
c68c7f8
Compare
Done, PTAL. |
Please add a new series of tests dedicated to your new format flag in format_test.go, with infinities and nans too.
LGTM otherwise
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Previously, the FmtParsable directive wouldn't produce a parsable representation for some floats and decimals, in the context of other expressions. In particular, negative floats and decimals would format like `-10.0:::FLOAT`. This seems fine, but since the `:::` operator binds more closely than the `-` operator, an expression like `(-10.0:::FLOAT)::STRING` would get formatted to `-10.0:::FLOAT::STRING`, which is of course invalid as there's no unary negative operator for the string datatype. Now, floats and decimals are marked as unambiguously formatted datatypes and take care of disambiguating themselves with a type annotation if necessary, as well as further-disambiguating parentheses if the numbers are nuegative. Release note (bug fix): correct the round-trip formatting of negative floats and decimals in the context of other expressions when executing in a distributed flow.
jordanlewis
force-pushed
the
disambig-float-dec
branch
from
August 1, 2018 16:44
c68c7f8
to
22cbf6b
Compare
Done. TFTR! |
bors r+ |
craig bot
pushed a commit
that referenced
this pull request
Aug 1, 2018
28072: rangefeed: create new rangefeed package r=nvanbenschoten a=nvanbenschoten This is the first "mergable" part of #27285. The change introduces a new rangefeed package, which exports a `Processor` that manages a set of rangefeed registrations and handles the routing of logical updates to these registrations. While routing logical updates to rangefeed registrations, the processor performs two important tasks: 1. it translates logical updates into rangefeed events. These logical updates are provided to the Processor through its `ConsumeLogicalOps` method. 2. it transforms a range-level closed timestamp to a rangefeed-level resolved timestamp. Closed timestamp updates are passed to the Processor through its `ForwardClosedTS` method. In order to perform its second task, a `Processor` hold on to a `resolvedTimestamp` object. A rangefeed's "resolved timestamp" is defined as the timestamp at which no future updates will be emitted to the feed at or before. The timestamp is monotonically increasing and is communicated through RangeFeedCheckpoint notifications whenever it changes. The `resolvedTimestamp` itself holds on to a `unresolvedIntentQueue` (described in #26782) which allows it to efficiently track unresolved intents that it observes in logical updates provided to the Processor. There are two major pieces of this package missing. The first is catch up scans for new registrations and the second is a mechanism to push intents that are old enough to be holding back the resolved timestamp. The change doesn't plug anything in yet, but a rough draft of the plumbing can be seen in #27285. Release note: None 28129: sql: disambiguate float,decimal formatting r=jordanlewis a=jordanlewis Previously, the FmtParsable directive wouldn't produce a parsable representation for some floats and decimals, in the context of other expressions. In particular, negative floats and decimals would format like `-10.0:::FLOAT`. This seems fine, but since the `:::` operator binds more closely than the `-` operator, an expression like `(-10.0:::FLOAT)::STRING` would get formatted to `-10.0:::FLOAT::STRING`, which is of course invalid as there's no unary negative operator for the string datatype. Now, floats and decimals are marked as unambiguously formatted datatypes and take care of disambiguating themselves with a type annotation if necessary, as well as further-disambiguating parentheses if the numbers are nuegative. Release note (bug fix): correct the round-trip formatting of negative floats and decimals in the context of other expressions when executing in a distributed flow. Co-authored-by: Nathan VanBenschoten <[email protected]> Co-authored-by: Jordan Lewis <[email protected]>
Build succeeded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the FmtParsable directive wouldn't produce a parsable
representation for some floats and decimals, in the context of other
expressions. In particular, negative floats and decimals would format
like
-10.0:::FLOAT
. This seems fine, but since the:::
operatorbinds more closely than the
-
operator, an expression like(-10.0:::FLOAT)::STRING
would get formatted to-10.0:::FLOAT::STRING
, which is of course invalid as there's no unarynegative operator for the string datatype.
Now, floats and decimals are marked as unambiguously formatted datatypes
and take care of disambiguating themselves with a type annotation if
necessary, as well as further-disambiguating parentheses if the numbers
are nuegative.
Release note (bug fix): correct the round-trip formatting of negative
floats and decimals in the context of other expressions when executing
in a distributed flow.