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

Fix missing order by fields in SELECT statement #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

isinyaaa
Copy link

@isinyaaa isinyaaa commented Sep 13, 2024

Currently, it's not possible to order by creation time or update time when using a MySQL backend. The PostgresQL backend also won't allow ordering by update time.

All such queries fail with (e.g. on MySQL):

rpc error: code = Internal desc = mysql_query failed: errno: Expression #1 of ORDER BY clause is not in SELECT list, references column 'model_registry.table_0.create_time_since_epoch' which is not in SELECT list; this is incompatible with DISTINCT, error: Expression #1 of ORDER BY clause is not in SELECT list, references column 'model_registry.table_0.create_time_since_epoch' which is not in SELECT list; this is incompatible with DISTINCT

Description

Fixes missing order by fields in SELECT statement.

Fixes: kubeflow/model-registry#358

How Has This Been Tested?

See opendatahub-io#12.

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Signed-off-by: Isabella Basso do Amaral <[email protected]>
@isinyaaa
Copy link
Author

@XinranTang hi, could you take a look?

Copy link

@chensun chensun left a comment

Choose a reason for hiding this comment

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

Overall LGTM. But I'll defer to MLMD owner for the formal review.

nit: Can you add some unit tests for the change? It seems there're adjacent test file: ml_metadata/metadata_store/postgresql_query_executor_test.cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MLMD: order_by_creation_time on model iteration fails to execute
2 participants