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

[V1] Use consistent names across PType and Datum #1546

Merged
merged 2 commits into from
Aug 14, 2024
Merged

[V1] Use consistent names across PType and Datum #1546

merged 2 commits into from
Aug 14, 2024

Conversation

rchowell
Copy link
Contributor

Description

This PR updates the PType and Datum classes to use consistent static method names for types/values.

Follow-Up Considerations

  • Removal of symbol and sexp?
  • Arbitrary precision type modeling.
  • Replace static methods with factories.

Other Information

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rchowell rchowell requested a review from johnedquinn August 14, 2024 17:17
@rchowell rchowell changed the title Use consistent names across PType and Datum [V1] Use consistent names across PType and Datum Aug 14, 2024
Copy link

github-actions bot commented Aug 14, 2024

Conformance comparison report-Cross Engine

Base (legacy) eval +/-
% Passing 90.72% 96.05% 5.33%
✅ Passing 5329 5643 314
❌ Failing 545 232 -313
🔶 Ignored 0 0 0
Total Tests 5874 5875 1
Number passing in both: 5175

Number failing in both: 77

Number passing in legacy engine but fail in eval engine: 155

Number failing in legacy engine but pass in eval engine: 468
⁉️ CONFORMANCE REPORT REGRESSION DETECTED ⁉️
The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.
468 test(s) were failing in legacy but now pass in eval. Before merging, confirm they are intended to pass.
The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.

Conformance comparison report-Cross Commit-LEGACY

Base (8717275) 620da52 +/-
% Passing 90.74% 90.72% -0.02%
✅ Passing 5330 5329 -1
❌ Failing 544 545 1
🔶 Ignored 0 0 0
Total Tests 5874 5874 0
Number passing in both: 5329

Number failing in both: 544

Number passing in Base (8717275) but now fail: 1

Number failing in Base (8717275) but now pass: 0
⁉️ CONFORMANCE REPORT REGRESSION DETECTED ⁉️. The following test(s) were previously passing but now fail:

Click here to see
  • MYSQL_SELECT_29, compileOption: LEGACY

Conformance comparison report-Cross Commit-EVAL

Base (8717275) 620da52 +/-
% Passing 96.05% 96.05% 0.00%
✅ Passing 5643 5643 0
❌ Failing 232 232 0
🔶 Ignored 0 0 0
Total Tests 5875 5875 0
Number passing in both: 5643

Number failing in both: 232

Number passing in Base (8717275) but now fail: 1

Number failing in Base (8717275) but now pass: 1
⁉️ CONFORMANCE REPORT REGRESSION DETECTED ⁉️. The following test(s) were previously passing but now fail:

Click here to see
  • Example 6 — Value Coercion, compileOption: LEGACY
The following test(s) were previously failing but now pass. Before merging, confirm they are intended to pass:
Click here to see
  • Example 6 — Value Coercion, compileOption: LEGACY

@NotNull
static Datum tinyInt(byte value) {
return new DatumByte(value, PType.typeTinyInt());
static Datum tinyint(byte value) {
Copy link
Member

Choose a reason for hiding this comment

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

Any reason you opted to remove the camel-case? Also, does this leave a green-squiggly on your IDE?

Copy link
Contributor Author

@rchowell rchowell Aug 14, 2024

Choose a reason for hiding this comment

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

No squiggly, but the naming is quite simple – spaces are underscores in snake, or capital for camel.

However, note that most types don't have spaces.

Examples

TINYINT -- sql
tinyint() -- method

DOUBLE PRECISION -- sql
doublePrecision() -- method

VARCHAR -- sql
varchar() -- method

CHARACTER VARYING -- sql
characterVarying() -- method

Not everything is that consistent because of reserved words in Java, and I've chosen to shorten some redundant/wordy things – for example TIME_WITH_TIMEZONE is easy to shorten to TIMEZ

}

@NotNull
static Datum symbol(@NotNull String value) {
return new DatumString(value, PType.typeSymbol());
static Datum timeWithoutTZ(@NotNull Time value) {
Copy link
Member

Choose a reason for hiding this comment

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

From your naming in PType, I would've thought that the static method would be called time and timez.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should've been, I need to update.

@@ -236,12 +236,12 @@ internal object CastTable {
)
}
register(SMALLINT, DECIMAL_ARBITRARY) { x, _ ->
Copy link
Member

Choose a reason for hiding this comment

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

With the renaming of INT_ARBITRARY, I would've thought you would remove DECIMAL_ARBITRARY. Is this reserved for another PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another PR. I started to do some of the things listed in the follow-ups, but then the PR got too complicated.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (v1@8717275). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             v1    #1546   +/-   ##
=====================================
  Coverage      ?   77.18%           
  Complexity    ?     2514           
=====================================
  Files         ?      254           
  Lines         ?    18583           
  Branches      ?     3517           
=====================================
  Hits          ?    14343           
  Misses        ?     3208           
  Partials      ?     1032           
Flag Coverage Δ
EXAMPLES 80.07% <ø> (?)
LANG 77.10% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rchowell rchowell merged commit 6cb7891 into v1 Aug 14, 2024
14 checks passed
@rchowell rchowell deleted the v1-ptypes branch August 14, 2024 21:53
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.

3 participants