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

Replace min/max helpers with built-in min/max #8719

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

Juneezee
Copy link
Contributor

@Juneezee Juneezee commented Jan 7, 2025

We can use the built-in min and max functions since Go 1.21.

Reference: https://go.dev/ref/spec#Min_and_max

We can use the built-in `min` and `max` functions since Go 1.21.

Reference: https://go.dev/ref/spec#Min_and_max
Signed-off-by: Eng Zer Jun <[email protected]>
@macneale4 macneale4 self-requested a review January 9, 2025 18:04
@macneale4
Copy link
Contributor

Thanks for the submission! I'm going to move this into a PR I own. I think that's what is causing the failed checks.

@macneale4
Copy link
Contributor

Copied PR here: #8726

@Juneezee
Copy link
Contributor Author

Juneezee commented Jan 9, 2025

Thanks for the submission! I'm going to move this into a PR I own. I think that's what is causing the failed checks.

I think the ${{ github.head_ref }} does not work for fork repositories.

- name: Checkout PR HEAD REF
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

We can see from the job log that it is trying to checkout refactor/minmax, but this branch only exists in my fork repository.

https://github.com/dolthub/dolt/actions/runs/12662844114/job/35386960409#step:4:3

Perhaps we should also set the repository for actions/checkout? actions/checkout#551 (comment)

@Juneezee
Copy link
Contributor Author

Juneezee commented Jan 9, 2025

According to https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context, it looks like github.ref is the correct one:

The fully-formed ref of the branch or tag that triggered the workflow run. ... For workflows triggered by pull_request, this is the pull request merge branch. ... The ref given is fully-formed, for pull requests it is refs/pull/<pr_number>/merge

Copy link
Contributor

@macneale4 macneale4 left a comment

Choose a reason for hiding this comment

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

LGTM. And passed CI. Thanks for the contribution!

@macneale4 macneale4 merged commit 0cbfe0e into dolthub:main Jan 9, 2025
53 of 56 checks passed
@macneale4
Copy link
Contributor

Thanks for the suggestions on getting CI to work. I've passed your suggestions to our team!

Copy link

@coffeegoddd DOLT

test_name detail row_cnt sorted mysql_time sql_mult cli_mult
batching LOAD DATA 10000 1 0.06 1.33
batching batch sql 10000 1 0.1 1.2
batching by line sql 10000 1 0.1 1.2
blob 1 blob 200000 1 0.92 3.71 4.37
blob 2 blobs 200000 1 0.9 4.29 4.7
blob no blob 200000 1 0.91 2.36 2.7
col type datetime 200000 1 0.85 2.26 2.51
col type varchar 200000 1 0.73 3.15 3.53
config width 2 cols 200000 1 0.8 2.4 2.64
config width 32 cols 200000 1 1.88 2.03 2.79
config width 8 cols 200000 1 1 2.24 2.58
pk type float 200000 1 0.81 2.4 2.68
pk type int 200000 1 0.81 2.37 2.63
pk type varchar 200000 1 3.39 0.73 0.78
row count 1.6mm 1600000 1 5.68 2.85 2.71
row count 400k 400000 1 1.46 2.71 2.73
row count 800k 800000 1 2.9 2.78 2.67
secondary index four index 200000 1 3.65 1.33 1.22
secondary index no secondary 200000 1 0.92 2.33 2.64
secondary index one index 200000 1 1.16 2.31 2.43
secondary index two index 200000 1 2.04 1.71 1.75
sorting shuffled 1mm 1000000 0 5.16 2.71 2.64
sorting sorted 1mm 1000000 1 5.13 2.7 2.65

Copy link

@coffeegoddd DOLT

name detail mean_mult
dolt_blame_basic system table 1.2
dolt_blame_commit_filter system table 3.01
dolt_commit_ancestors_commit_filter system table 0.63
dolt_commits_commit_filter system table 1.11
dolt_diff_log_join_from_commit system table 2.96
dolt_diff_log_join_to_commit system table 2.92
dolt_diff_table_from_commit_filter system table 1.18
dolt_diff_table_to_commit_filter system table 1.19
dolt_diffs_commit_filter system table 1.03
dolt_history_commit_filter system table 1.31
dolt_log_commit_filter system table 1.05

Copy link

@coffeegoddd DOLT

name add_cnt delete_cnt update_cnt latency
adds_only 60000 0 0 1.15
adds_updates_deletes 60000 60000 60000 4.53
deletes_only 0 60000 0 2.47
updates_only 0 0 60000 3.06

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

Successfully merging this pull request may close these issues.

3 participants