Skip to content

minor: fix bug in downcast_value! macro (T --> $T) - #3486

Merged
yjshen merged 1 commit into
apache:masterfrom
alamb:alamb/fix_downcast_array
Sep 15, 2022
Merged

minor: fix bug in downcast_value! macro (T --> $T)#3486
yjshen merged 1 commit into
apache:masterfrom
alamb:alamb/fix_downcast_array

Conversation

@alamb

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

N/A

Rationale for this change

There is a bug pointed out by @iajoiner#3484 (comment)

We don't see the problem because the only uses of the variant of the macro are all in generics that use T

When I remove that variant, you can see the locations

error: no rules expected the token `,`
--> datafusion/physical-expr/src/aggregate/approx_distinct.rs:252:58
|
252 | downcast_value!(values[0], GenericBinaryArray, T);
| ^ no rules expected this token in macro call
error: no rules expected the token `,`
--> datafusion/physical-expr/src/aggregate/approx_distinct.rs:268:58
|
268 | downcast_value!(values[0], GenericStringArray, T);
| ^ no rules expected this token in macro call
error: no rules expected the token `,`
--> datafusion/physical-expr/src/aggregate/approx_distinct.rs:284:82
|
284 | let array: &PrimitiveArray<T> = downcast_value!(values[0], PrimitiveArray, T);
| ^ no rules expected this token in macro call

What changes are included in this PR?

  1. Change T to $T

Are there any user-facing changes?

No

@alamb
alamb marked this pull request as ready for review September 14, 2022 19:17
@alambalamb changed the title minor: fix bug in downcast_value! macrominor: fix bug in downcast_value! macro (T --> $T)Sep 14, 2022
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #3486 (adb4eb8) into master (9d028b3) will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@ Coverage Diff @@## master #3486 +/- ##
=======================================
Coverage 85.75% 85.76% =======================================
Files 299 299 Lines 55282 55282 =======================================
+ Hits 47409 47410 +1 + Misses 7873 7872 -1 
Impacted FilesCoverage Δ
datafusion/common/src/lib.rs0.00% <0.00%> (ø)
datafusion/expr/src/logical_plan/plan.rs77.85% <0.00%> (+0.16%)⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@yjshen
yjshen merged commit f52d8af into apache:masterSep 15, 2022
@ursabot

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 06f01ea and contender = f52d8af. f52d8af 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

@alamb
alamb deleted the alamb/fix_downcast_array branch September 15, 2022 12:41
Sign up for freeto 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

@alamb@codecov-commenter@ursabot@yjshen