Skip to content

Fixed parseDateTime64BestEffort implementation#11038

Merged
vitlibar merged 1 commit intoClickHouse:masterfrom
Enmk:parseDateTime64BestEffort_fix
May 22, 2020
Merged

Fixed parseDateTime64BestEffort implementation#11038
vitlibar merged 1 commit intoClickHouse:masterfrom
Enmk:parseDateTime64BestEffort_fix

Conversation

@Enmk
Copy link
Copy Markdown
Contributor

@Enmk Enmk commented May 19, 2020

Fixed argument resolution issues.
Added tests and made sure orNull and orZero variants also work correctly.

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fixed parseDateTime64BestEffort argument resolution bugs. #10925

closes: #10925

@blinkov blinkov added the pr-bugfix Pull request with bugfix, not backported by default label May 19, 2020
@vitlibar vitlibar self-assigned this May 19, 2020
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

endsWith() seems to be more suitable here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I've just tossed that under an else-branch of if constexpr, so that piece is mostly as it was before.

IMO that exact piece (and the whole approach of how compile-time branching based on function return type is done) should be re-thought and re-designed, this piece is not the worst, but it is becoming a mess.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little offtopic. We have the function parseDateTime64BestEffort(), but we don't have function parseDateTime64(), right? I wonder how we came to that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfectly aligned with DateTime case: there is parseDateTimeBestEffort, but no parseDateTime function. IIRC, 'non-best-effort' parsing is done on casting/building DateTime/DateTime64 values from string explicitly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't simple return false enough here?

Copy link
Copy Markdown
Contributor Author

@Enmk Enmk May 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, let me fix it.

Fixed argument resolution issues.
Added tests and made sure -orNull and -orZero variants alwo work correctly.
@vitlibar vitlibar merged commit 5a0f356 into ClickHouse:master May 22, 2020
nikitamikhaylov pushed a commit to nikitamikhaylov/ClickHouse that referenced this pull request May 23, 2020
…rt_fix

Fixed parseDateTime64BestEffort implementation

(cherry picked from commit 5a0f356)
nikitamikhaylov added a commit that referenced this pull request May 23, 2020
* Merge pull request #10910 from filimonov/kafka_drop_hang_fix

Fix for the hang during deletion of engine=Kafka

(cherry picked from commit 0fd0711)

* Merge pull request #10986 from ClickHouse/try-fix-use-after-free-mergetree

Try to fix use-after-free error in MergeTree

(cherry picked from commit 073dc2e)

* Merge pull request #11048 from filimonov/kafka_missed_data_during_drop

Fixes the potential missed data during termination of Kafka engine table

(cherry picked from commit b82c633)

* Merge pull request #11109 from ClickHouse/less_verbose_logging

Less verbose logging in mutation finalization task

(cherry picked from commit 1906762)

* Merge pull request #11074 from Jokser/memory-leak-in-register-disk-s3

Fix memory leak in registerDiskS3

(cherry picked from commit 4a237fa)

* Merge pull request #11038 from Enmk/parseDateTime64BestEffort_fix

Fixed parseDateTime64BestEffort implementation

(cherry picked from commit 5a0f356)

Co-authored-by: alexey-milovidov <[email protected]>
Co-authored-by: alesapin <[email protected]>
Co-authored-by: Vitaly Baranov <[email protected]>
nikitamikhaylov pushed a commit to nikitamikhaylov/ClickHouse that referenced this pull request May 23, 2020
…rt_fix

Fixed parseDateTime64BestEffort implementation

(cherry picked from commit 5a0f356)
nikitamikhaylov added a commit that referenced this pull request May 23, 2020
* Merge pull request #11109 from ClickHouse/less_verbose_logging

Less verbose logging in mutation finalization task

(cherry picked from commit 1906762)

* Merge pull request #11038 from Enmk/parseDateTime64BestEffort_fix

Fixed parseDateTime64BestEffort implementation

(cherry picked from commit 5a0f356)

* Merge pull request #10741 from hczhcz/patch-0422

Fix OrNull and OrDefault

(cherry picked from commit 699ef4f)

Co-authored-by: alesapin <[email protected]>
Co-authored-by: Vitaly Baranov <[email protected]>
Co-authored-by: alexey-milovidov <[email protected]>
KochetovNicolai pushed a commit that referenced this pull request Jun 8, 2020
Fixed parseDateTime64BestEffort implementation

(cherry picked from commit 5a0f356)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-docs-needed pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parseDateTime64BestEffort is unusable

7 participants