Skip to content

wip: Implement extract epoch - #2786

Closed
mkmik wants to merge 1 commit into
apache:masterfrom
mkmik:extract_epoch
Closed

mkmik wants to merge 1 commit into
apache:masterfrom
mkmik:extract_epoch

Conversation

@mkmik

@mkmik mkmik commented Jun 24, 2022

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #2785

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions Bot added the physical-expr Changes to the physical-expr crates label Jun 24, 2022
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #2786 (bec8956) into master (11ae737) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #2786      +/-   ##
==========================================
- Coverage   85.15%   85.11%   -0.04%     
==========================================
  Files         273      273              
  Lines       48076    48096      +20     
==========================================
  Hits        40938    40938              
- Misses       7138     7158      +20     
Impacted Files Coverage Δ
...tafusion/physical-expr/src/datetime_expressions.rs 69.39% <0.00%> (-8.52%) ⬇️
datafusion/core/src/physical_plan/metrics/value.rs 86.93% <0.00%> (-0.51%) ⬇️
datafusion/expr/src/logical_plan/plan.rs 73.91% <0.00%> (+0.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11ae737...bec8956. Read the comment docs.

"epoch" => extract_date_part!(array, extract_epoch),
_ => Err(DataFusionError::Execution(format!(
"Date part '{}' not supported",
"Date partx '{}' not supported",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Date partx '{}' not supported",
"Date part '{}' not supported",

if array.is_null(i) {
b.append_null()?;
} else {
let scale = match unit {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

T: ArrowTemporalType + ArrowNumericType,
i64: std::convert::From<T::Native>,
{
let mut b = Int32Builder::new(array.len());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note: In terms of performance (and readability), it is better to avoid the builder/value etc. and work directly on the values (check the arrow-rs kernels for examples).
Ok to leave this for a future PR if you like 👍

@alamb

alamb commented Jan 14, 2023

Copy link
Copy Markdown
Contributor

This PR is more than 6 month old, so closing it down for now to clean up the PR list. Please reopen if this is a mistake and you plan to work on it more

@alamb alamb closed this Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-expr Changes to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EXTRACT(EPOCH from column)

4 participants