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

[CORE] Use collection interface in method parameter and return type #3603

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

liujiayi771
Copy link
Contributor

@liujiayi771 liujiayi771 commented Nov 2, 2023

What changes were proposed in this pull request?

It is recommended to use abstract interfaces for method parameters and return type instead of concrete implementations.

After modifying the method parameters and return type to abstract interface types, many codes can be rewritten in a more functional style. This PR also includes these modifications as well.

How was this patch tested?

Existing test cases

Copy link

github-actions bot commented Nov 2, 2023

Thanks for opening a pull request!

Could you open an issue for this pull request on Github Issues?

https://github.com/oap-project/gluten/issues

Then could you also rename commit message and pull request title in the following format?

[GLUTEN-${ISSUES_ID}][COMPONENT]feat/fix: ${detailed message}

See also:

Copy link

github-actions bot commented Nov 2, 2023

Run Gluten Clickhouse CI

Copy link

github-actions bot commented Nov 2, 2023

Run Gluten Clickhouse CI

1 similar comment
Copy link

github-actions bot commented Nov 2, 2023

Run Gluten Clickhouse CI

Comment on lines 24 to 25
import java.lang.{Long => JLong}
import java.util.{HashMap => JHashMap}
Copy link
Member

@zhztheplayer zhztheplayer Nov 3, 2023

Choose a reason for hiding this comment

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

Can this import statement be generated by some kind of tools? Or the code was manually written?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made the modifications manually. However, upon carefully examining the code of Spark, I noticed that it actually has a lot of inconsistency in its usage. There are various conventions being used, with most of them using JList, but java.util.List and util.List are still present as well. I am now questioning whether it is necessary to make these modifications here, as it would be difficult to ensure that all future developers maintain a consistent style.

Copy link
Member

@zhztheplayer zhztheplayer Nov 3, 2023

Choose a reason for hiding this comment

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

as it would be difficult to ensure that all future developers maintain a consistent style.

Yes so it's not necessary to become a coding style or restriction. Sounds fair to me.

Copy link

github-actions bot commented Nov 3, 2023

Run Gluten Clickhouse CI

1 similar comment
Copy link

github-actions bot commented Nov 3, 2023

Run Gluten Clickhouse CI

Copy link

github-actions bot commented Nov 3, 2023

Run Gluten Clickhouse CI

@liujiayi771 liujiayi771 changed the title [CORE] Fix java collection usage [CORE] Use collection interface in method parameter and return type Nov 3, 2023
Copy link

github-actions bot commented Nov 3, 2023

Run Gluten Clickhouse CI

@liujiayi771 liujiayi771 marked this pull request as ready for review November 3, 2023 07:52
Copy link

github-actions bot commented Nov 3, 2023

Run Gluten Clickhouse CI

@liujiayi771
Copy link
Contributor Author

@zhztheplayer @rui-mo It's ready for review. I have removed many unnecessary import modifications.

@rui-mo rui-mo merged commit c470b9b into apache:main Nov 7, 2023
16 checks passed
@GlutenPerfBot
Copy link
Contributor

===== Performance report for TPCH SF2000 with Velox backend, for reference only ====

query log/native_3603_time.csv log/native_master_11_06_2023_d57fdf26f_time.csv difference percentage
q1 34.25 33.34 -0.908 97.35%
q2 24.81 24.84 0.027 100.11%
q3 38.05 38.31 0.255 100.67%
q4 37.00 37.40 0.398 101.08%
q5 71.42 70.83 -0.592 99.17%
q6 8.02 7.74 -0.281 96.50%
q7 85.74 85.97 0.234 100.27%
q8 86.46 84.68 -1.779 97.94%
q9 118.75 124.39 5.638 104.75%
q10 52.79 54.67 1.874 103.55%
q11 19.68 19.96 0.274 101.39%
q12 27.34 24.52 -2.824 89.67%
q13 48.84 50.37 1.523 103.12%
q14 18.28 18.50 0.221 101.21%
q15 31.40 32.09 0.693 102.21%
q16 16.65 16.51 -0.137 99.17%
q17 101.86 100.90 -0.967 99.05%
q18 148.86 148.27 -0.594 99.60%
q19 14.90 14.74 -0.155 98.96%
q20 29.96 30.95 0.994 103.32%
q21 225.64 225.06 -0.579 99.74%
q22 13.26 13.61 0.343 102.59%
total 1253.99 1257.65 3.661 100.29%

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.

4 participants