Skip to content
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

chore: bump datafusion version to fix last_value regression #4169

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

MichaelScofield
Copy link
Collaborator

@MichaelScofield MichaelScofield commented Jun 19, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

... to the datafusion commit with PR apache/datafusion#10783.

Now last_value with string arg works:

mysql> select last_value('3');
+-----------------------+
| last_value(Utf8("3")) |
+-----------------------+
| 3                     |
+-----------------------+
1 row in set (0.04 sec)

Also fix #4096 :

mysql> CREATE TABLE monitor (
    ->   host STRING,
    ->   ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP() TIME INDEX,
    ->   cpu FLOAT64 DEFAULT 0,
    ->   memory FLOAT64,
    ->   PRIMARY KEY(host)) ENGINE=mito;
Query OK, 0 rows affected (0.04 sec)

mysql> INSERT INTO monitor
    -> VALUES
    ->     ("127.0.0.1", 1, 0.5, 0.9),
    ->     ("127.0.0.2", 2, 0.6, 0.8),
    ->     ("127.0.0.3", 3, 0.7, 0.7),
    ->     ("127.0.0.4", 4, 0.8, 0.6),
    ->     ("127.0.0.4", 5, 0.9, 0.5),
    ->     ("127.0.0.5", 6, 1.0, 0.4);
Query OK, 6 rows affected (0.01 sec)

mysql> select last_value(cpu order by ts) from monitor;
+--------------------------------------------------------------+
| last_value(monitor.cpu) ORDER BY [monitor.ts ASC NULLS LAST] |
+--------------------------------------------------------------+
|                                                            1 |
+--------------------------------------------------------------+
1 row in set (0.05 sec)

mysql> select first_value(cpu order by ts) from monitor;
+---------------------------------------------------------------+
| first_value(monitor.cpu) ORDER BY [monitor.ts ASC NULLS LAST] |
+---------------------------------------------------------------+
|                                                           0.5 |
+---------------------------------------------------------------+
1 row in set (0.03 sec)

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Jun 19, 2024
Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

LGTM

src/datatypes/src/value.rs Outdated Show resolved Hide resolved
src/datatypes/src/vectors/helper.rs Outdated Show resolved Hide resolved
@killme2008
Copy link
Contributor

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 40.90909% with 26 lines in your changes missing coverage. Please review.

Project coverage is 84.83%. Comparing base (22d1268) to head (b52ec05).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4169      +/-   ##
==========================================
- Coverage   85.16%   84.83%   -0.33%     
==========================================
  Files        1020     1020              
  Lines      179630   179635       +5     
==========================================
- Hits       152976   152392     -584     
- Misses      26654    27243     +589     

@fengjiachun
Copy link
Collaborator

This PR also fixed #4096

Copy link
Collaborator

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

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

LGTM

@MichaelScofield MichaelScofield added this pull request to the merge queue Jun 19, 2024
@waynexia waynexia removed this pull request from the merge queue due to a manual request Jun 19, 2024
@MichaelScofield MichaelScofield added this pull request to the merge queue Jun 19, 2024
Merged via the queue into GreptimeTeam:main with commit cc2f7ef Jun 19, 2024
51 checks passed
@MichaelScofield MichaelScofield deleted the chore/update-df branch June 19, 2024 08:04
zyy17 pushed a commit to zyy17/greptimedb that referenced this pull request Jun 22, 2024
…meTeam#4169)

* chore: bump datafusion version to fix `last_value` regression

* fix: resolve PR comments

* fix ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

last_value()/first_value() returns incorrect and unstable result
3 participants