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

Use enhanced switch #21578

Merged
merged 1 commit into from
Apr 18, 2024
Merged

Use enhanced switch #21578

merged 1 commit into from
Apr 18, 2024

Conversation

wendigo
Copy link
Contributor

@wendigo wendigo commented Apr 16, 2024

No description provided.

@wendigo wendigo added the no-release-notes This pull request does not require release notes entry label Apr 16, 2024
@cla-bot cla-bot bot added the cla-signed label Apr 16, 2024
@wendigo wendigo requested review from ebyhr and hashhar April 16, 2024 21:15
@github-actions github-actions bot added tests:hive hudi Hudi connector iceberg Iceberg connector delta-lake Delta Lake connector hive Hive connector labels Apr 16, 2024
@wendigo wendigo requested review from findepi and losipiuk April 17, 2024 07:19
case LOOKUP_SOURCE_BUILT -> lookupSourceNotNeeded.orElseThrow(() -> new IllegalStateException("Lookup source built, but disposal future not set"));
case INPUT_SPILLED -> spilledLookupSourceHandle.getUnspillingOrDisposeRequested();
case INPUT_UNSPILLING -> unspillInProgress.map(HashBuilderOperator::asVoid)
.orElseThrow(() -> new IllegalStateException("Unspilling in progress, but unspilling future not set"));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

move to previous line

case AND:
case OR:
case COALESCE:
// All the arguments after the first one are assumed to be conditionally evaluated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

redundant comment

case BETWEEN:
generator = new BetweenCodeGenerator(specialForm);
break;
new SwitchCodeGenerator(specialForm);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

move comment above

return DoubleOperators.castToVarchar(UNBOUNDED_LENGTH, parser.getDoubleValue());
case VALUE_NUMBER_INT:
DoubleOperators.castToVarchar(UNBOUNDED_LENGTH, parser.getDoubleValue());
case VALUE_NUMBER_INT ->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

move comment above

default:
throw new JsonCastException(format("Unexpected token when cast to %s: %s", StandardTypes.REAL, parser.getText()));
}
(long) floatToRawIntBits(parser.getFloatValue());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

move comment above

// org.apache.hadoop.hive.ql.exec.Utilities.getBucketingVersion is more permissive and treats any non-number as "1"
throw new TrinoException(StandardErrorCode.NOT_SUPPORTED, format("Unsupported bucketing version: '%s'", bucketingVersion));
}
// org.apache.hadoop.hive.ql.exec.Utilities.getBucketingVersion is more permissive and treats any non-number as "1"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

move above default

case DESC_NULLS_LAST:
return switch (sortItem.sortOrder()) {
// In MariaDB ASC implies NULLS FIRST
case ASC_NULLS_FIRST, DESC_NULLS_LAST ->
// In MariaDB DESC implies NULLS LAST
Copy link
Contributor Author

Choose a reason for hiding this comment

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

merge two comments

@wendigo wendigo force-pushed the serafin/enhanced-switchof branch 2 times, most recently from 0141df9 to 9e11d12 Compare April 17, 2024 19:07
@wendigo wendigo force-pushed the serafin/enhanced-switchof branch from 9e11d12 to a6aa76e Compare April 18, 2024 11:20
@wendigo
Copy link
Contributor Author

wendigo commented Apr 18, 2024

@findepi it's green after rebasing :) Please review

@wendigo wendigo merged commit 5a3d328 into master Apr 18, 2024
103 checks passed
@wendigo wendigo deleted the serafin/enhanced-switchof branch April 18, 2024 14:33
@github-actions github-actions bot added this to the 446 milestone Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed delta-lake Delta Lake connector hive Hive connector hudi Hudi connector iceberg Iceberg connector no-release-notes This pull request does not require release notes entry
Development

Successfully merging this pull request may close these issues.

2 participants