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 decimal scalar dyn kernels #5179

Merged
merged 4 commits into from
Feb 6, 2023

Conversation

viirya
Copy link
Member

@viirya viirya commented Feb 4, 2023

Which issue does this PR close?

Follow of #5151.

Rationale for this change

For add_decimal_dyn_scalar and subtract_decimal_dyn_scalar, it should call get_precision_scale and decimal_array_with_precision_scale like multiply_decimal_dyn_scalar and divide_decimal_dyn_scalar as the input/output could be DictionaryArray.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the physical-expr Physical Expressions label Feb 4, 2023
@@ -189,28 +189,20 @@ pub(crate) fn add_decimal(
}

pub(crate) fn add_decimal_dyn_scalar(left: &dyn Array, right: i128) -> Result<ArrayRef> {
let left_decimal = left.as_any().downcast_ref::<Decimal128Array>().unwrap();
let (precision, scale) = get_precision_scale(left)?;
Copy link
Member Author

Choose a reason for hiding this comment

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

In last PR, forgot to update this and there.

@viirya
Copy link
Member Author

viirya commented Feb 4, 2023

CI seems broken:

warning: Not a git repository. Use --no-index to compare two paths outside a working tree
usage: git diff --no-index [<options>] <path> <path>

@viirya viirya force-pushed the arithmetic_dyn_scalar_followup branch from 9c1520c to 72367ed Compare February 4, 2023 23:02
@viirya
Copy link
Member Author

viirya commented Feb 4, 2023

Proposed CI fix at #5182.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

The changes to the Decimal logic makes sense to me (other than the changes to github config -- I think you can remove those prior to merge)

.github/workflows/dev.yml Outdated Show resolved Hide resolved
Operator::Plus,
ScalarValue::Dictionary(
Box::new(DataType::Int8),
Box::new(ScalarValue::Decimal128(Some(1), 10, 0)),
Copy link
Contributor

Choose a reason for hiding this comment

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

without this PR's code, is the actual type of the output array whatever the default precision of Decimal128 is (rather than 10, 0)?

Copy link
Member Author

@viirya viirya Feb 5, 2023

Choose a reason for hiding this comment

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

No, original code still modifies precision/scale for output array, but it just worked for primitive array not dictionary array.

This reverts commit 72367ed.
@viirya viirya merged commit 4233752 into apache:master Feb 6, 2023
@ursabot
Copy link

ursabot commented Feb 6, 2023

Benchmark runs are scheduled for baseline = a213d62 and contender = 4233752. 4233752 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

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

Successfully merging this pull request may close these issues.

3 participants