ARROW-835: [Format][C++][Java] Create a new Duration type - #3644

Closed
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type
Closed

ARROW-835: [Format][C++][Java] Create a new Duration type#3644
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type

Conversation

@emkornfield

@emkornfieldemkornfield commented Feb 14, 2019

Copy link
Copy Markdown
Contributor
  • Create a new DurationInterval type in format.
  • Implement all interval types in C++ and Java including integration test.

Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?

@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format] Add time resolution to Interval by creating a new typeARROW-352:[Format] Add time resolution to Interval by creating a new typeFeb 15, 2019
@codecov-io

codecov-io commented Feb 15, 2019

Copy link
Copy Markdown

Codecov Report

Merging #3644 into master will decrease coverage by <.01%.
The diff coverage is 84.24%.

Impacted file tree graph

@@ Coverage Diff @@## master #3644 +/- ##
==========================================
- Coverage 88.07% 88.06% -0.01% 
==========================================
Files 773 774 +1 Lines 96887 97162 +275 Branches 1251 1251 ==========================================
+ Hits 85329 85566 +237 - Misses 11322 11360 +38 
Partials 236 236
Impacted FilesCoverage Δ
cpp/src/arrow/ipc/read-write-test.cc99.81% <ø> (ø)⬆️
cpp/src/arrow/ipc/json-test.cc98.46% <ø> (ø)⬆️
cpp/src/arrow/visitor.h50% <ø> (ø)⬆️
cpp/src/arrow/scalar.h88.23% <ø> (ø)⬆️
cpp/src/arrow/array/builder_primitive.h95.86% <ø> (ø)⬆️
cpp/src/arrow/type_traits.h85.71% <0%> (-7.25%)⬇️
cpp/src/arrow/array/builder_dict.cc86.06% <0%> (-1.44%)⬇️
cpp/src/arrow/pretty_print.cc83.48% <0%> (-1.6%)⬇️
cpp/src/arrow/visitor.cc0% <0%> (ø)⬆️
cpp/src/arrow/type-test.cc99.21% <100%> (+0.05%)⬆️
... and 16 more

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 2ca6fe8...973d80f. Read the comment docs.

Comment threadformat/Schema.fbs Outdated
@emkornfieldemkornfield changed the title ARROW-352:[Format] Add time resolution to Interval by creating a new typeARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeFeb 23, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm could you look at the format changes to see if you are ok with them?
@pravindra Can you look at the impact on the java side (I added all the necessary java classes I think) to confirm this is acceptable for the Java?

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Failure was NodeJs

@koukou changed the title ARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeFeb 24, 2019
@pravindra

Copy link
Copy Markdown
Contributor

since this is a format change (backward compatible though), I'll wait for @wesm to approve too before merging.

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@pravindra thanks for the review

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Looking over the old e-mail threads it might be that TimeDelta or TimestampDelta is a better name for this type?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm based on comments on the other JIRAs CLs it seems like it would be desirable to add an implementation for C++, I can add that to this CL but would you mind taking a look to see if you are ok with naming/modeling (I would prefer not to have to refactor just due to naming issues if possible).

@emkornfieldemkornfield changed the title ARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 12, 2019
@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new DurationInterval typeApr 30, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

I believe the Python on OS/X error is spurious (it was green on previous build).

@wesm

wesm commented May 3, 2019

Copy link
Copy Markdown
Member

Will work on reviewing the C++ side of this

@wesmwesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The C++ side of this, and the changes to the Flatbuffers files, all looks good to me. Thanks @emkornfield for slogging through this and implementing C++, Java, and integration tests in one go!

One question I have is whether we want to commit to the name "DurationInterval" rather than alternatives such as "Duration" or "TimeDelta" or "TimeDuration". I don't think the names are sacred

Can someone (@siddharthteotia ?) carve out a little time to review the Java so we can try to get this merged soon?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think it's possible to collapse this into a single class? There was an effort to do this for Timestamp (with a TimeUnit class) but it failed only because Dremio had taken on dependency with the TimestampUNIT classes

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Potentially, I followed the pattern already established in the codebase, but I'm open to trying if it is desirable. @pravindra@siddharthteotia do you think this is desirable/possible?

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.

Sounds okay to me. Let's see what @siddharthteotia and @pravindra say.

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.

IMO, having a single class is definitely desirable. Single this one is starting on a fresh slate, it's worth a try.

Comment threadcpp/src/arrow/array.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, I'm a bit disappointed that we aren't deprecating this type =/

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I didn't want to get dragged into what it means deprecate this, should be easy enough to do if we want it. As noted below I tried to say it was optional which I seem to recall seeing this was ok on a previous ML thread.

Comment threadcpp/src/arrow/array/builder_time.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this redundant with type_fwd.h?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, it appears so, I'll push a commit removing them. It looks like there might be more redundancy in builder_primitive.h

Comment threadcpp/src/arrow/builder.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think static_cast (or checked_cast) is sufficient here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

Comment threadcpp/src/arrow/type.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: as far as naming I could see an argument for using

  • interval_duration
  • interval_day_time
  • interval_month

but I'm OK with the way things are here

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I could see this to, but I'm happier without the reverse notation.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

note "duration" conflicts with some of our time classes so I renamed to "duration_type", hopefully that is ok

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"some of our time classes"?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Need to look back I think it was in the vendored time library we were using. I can look deeper if you don't think there should be a conflict

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

looking again they shouldn't conflict, I will try to fix this today.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome, thanks.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

renamed. had to touch some of the vendored code.

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it. If it isn't being deprecated then it's reasonable to implement it in C++ and have integration tests

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm Thanks for the review I'll try to address comments in the next few days. In terms of naming, I don't know the etiquette for changing the name once it gets approved on the ML. If was going to change it, I think Duration would be my choice.

@pravindra already reviewed most of the java code, the main changes that happened where plumbing through support for the integration test.

Comment threadcpp/src/arrow/array/builder_dict.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just for your information.

These changes will be conflicted with #4255.
If #4255 is merged, we will be able to just remove these changes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, they were removed.

@emkornfieldemkornfield changed the title ARROW-835: [Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new Duration typeMay 13, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm I think I addressed all your feedback. The OS/X build seems to in an infinite CMake loop with something like

 the following targets are still affected by RPATH settings:
arrow_python_shared
arrow_shared
arrow_testing_shared
parquet_shared
plasma_shared

I'm not sure why my change would have caused this. Any thoughts?

@pravindra I was able to consolidate all the java vectors into one, could you take a look?

@emkornfield
emkornfieldforce-pushed the new_type branch 2 times, most recently from 2913b09 to 773a2b0CompareMay 15, 2019 19:28
@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Baffling

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

It must have something to do with this being an older PR. Is Appveyor enabled on your fork? If not I can push this to my fork to get an Appveyor build going

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

No appveyor isn't enabled on my fork. let me try squashing everything, see if that helps.

and mark DayTimeInterval as deprecated.
Provides implementation for Duration, DayTimeInterval and YearMonth
interval in C++ and Java (for duration). Adds integration test.
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Ahh, squash seems to have worked, lets hope things stay green.

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

@emkornfield it looks you made some changes to vendored code which I think we should try to avoid doing in general, can we open a JIRA to restore to the vendored version and address the name conflict another way? I don't want this issue to block the patch since I need this to go in and then rebase #4316 on top

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Appveyor appears to be about ~6 hours backed up so I'm going to push a branch on my fork to try to get a quicker thumbs up to merge this

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Here's an Appveyor build starting now on my fork which will take a while to run https://ci.appveyor.com/project/wesm/arrow/builds/24577591

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Thanks. https://issues.apache.org/jira/browse/ARROW-5346 opened to revert the changes. Right now the only solution seems like reordering includes in some cases or fixing upstream. I will have to think about this.

@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Appveyor build looks OK, I'm going to wait a little while yet to make sure the MinGW build works before merging

@emkornfield

emkornfield commented May 16, 2019

Copy link
Copy Markdown
ContributorAuthor

@wesm appveyor on your branch looks all green.

@wesmwesm closed this in 6f80ea4May 16, 2019
@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Awesome. Thanks @emkornfield!!

@emkornfield
emkornfield deleted the new_type branch May 16, 2019 03:19
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
- Create a new DurationInterval type in format.
- Implement all interval types in C++ and Java including integration test.
Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?
Author: Micah Kornfield <emkornfield@gmail.com>
Closesapache#3644 from emkornfield/new_type and squashes the following commits:
cc6d39c <Micah Kornfield> remove system clock
daf8b4f <Micah Kornfield> duration_type->duration
b064816 <Micah Kornfield> Introduce a new Duration type can that represent time deltas, and mark DayTimeInterval as deprecated.
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.

6 participants

@emkornfield@codecov-io@pravindra@wesm@kou@jacques-n
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

ARROW-835: [Format][C++][Java] Create a new Duration type - #3644

Closed
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type
Closed

ARROW-835: [Format][C++][Java] Create a new Duration type#3644
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type

Conversation

@emkornfield

@emkornfieldemkornfield commented Feb 14, 2019

Copy link
Copy Markdown
Contributor
  • Create a new DurationInterval type in format.
  • Implement all interval types in C++ and Java including integration test.

Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?

@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format] Add time resolution to Interval by creating a new typeARROW-352:[Format] Add time resolution to Interval by creating a new typeFeb 15, 2019
@codecov-io

codecov-io commented Feb 15, 2019

Copy link
Copy Markdown

Codecov Report

Merging #3644 into master will decrease coverage by <.01%.
The diff coverage is 84.24%.

Impacted file tree graph

@@ Coverage Diff @@## master #3644 +/- ##
==========================================
- Coverage 88.07% 88.06% -0.01% 
==========================================
Files 773 774 +1 Lines 96887 97162 +275 Branches 1251 1251 ==========================================
+ Hits 85329 85566 +237 - Misses 11322 11360 +38 
Partials 236 236
Impacted FilesCoverage Δ
cpp/src/arrow/ipc/read-write-test.cc99.81% <ø> (ø)⬆️
cpp/src/arrow/ipc/json-test.cc98.46% <ø> (ø)⬆️
cpp/src/arrow/visitor.h50% <ø> (ø)⬆️
cpp/src/arrow/scalar.h88.23% <ø> (ø)⬆️
cpp/src/arrow/array/builder_primitive.h95.86% <ø> (ø)⬆️
cpp/src/arrow/type_traits.h85.71% <0%> (-7.25%)⬇️
cpp/src/arrow/array/builder_dict.cc86.06% <0%> (-1.44%)⬇️
cpp/src/arrow/pretty_print.cc83.48% <0%> (-1.6%)⬇️
cpp/src/arrow/visitor.cc0% <0%> (ø)⬆️
cpp/src/arrow/type-test.cc99.21% <100%> (+0.05%)⬆️
... and 16 more

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 2ca6fe8...973d80f. Read the comment docs.

Comment threadformat/Schema.fbs Outdated
@emkornfieldemkornfield changed the title ARROW-352:[Format] Add time resolution to Interval by creating a new typeARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeFeb 23, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm could you look at the format changes to see if you are ok with them?
@pravindra Can you look at the impact on the java side (I added all the necessary java classes I think) to confirm this is acceptable for the Java?

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Failure was NodeJs

@koukou changed the title ARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeFeb 24, 2019
@pravindra

Copy link
Copy Markdown
Contributor

since this is a format change (backward compatible though), I'll wait for @wesm to approve too before merging.

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@pravindra thanks for the review

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Looking over the old e-mail threads it might be that TimeDelta or TimestampDelta is a better name for this type?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm based on comments on the other JIRAs CLs it seems like it would be desirable to add an implementation for C++, I can add that to this CL but would you mind taking a look to see if you are ok with naming/modeling (I would prefer not to have to refactor just due to naming issues if possible).

@emkornfieldemkornfield changed the title ARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 12, 2019
@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new DurationInterval typeApr 30, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

I believe the Python on OS/X error is spurious (it was green on previous build).

@wesm

wesm commented May 3, 2019

Copy link
Copy Markdown
Member

Will work on reviewing the C++ side of this

@wesmwesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The C++ side of this, and the changes to the Flatbuffers files, all looks good to me. Thanks @emkornfield for slogging through this and implementing C++, Java, and integration tests in one go!

One question I have is whether we want to commit to the name "DurationInterval" rather than alternatives such as "Duration" or "TimeDelta" or "TimeDuration". I don't think the names are sacred

Can someone (@siddharthteotia ?) carve out a little time to review the Java so we can try to get this merged soon?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think it's possible to collapse this into a single class? There was an effort to do this for Timestamp (with a TimeUnit class) but it failed only because Dremio had taken on dependency with the TimestampUNIT classes

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Potentially, I followed the pattern already established in the codebase, but I'm open to trying if it is desirable. @pravindra@siddharthteotia do you think this is desirable/possible?

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.

Sounds okay to me. Let's see what @siddharthteotia and @pravindra say.

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.

IMO, having a single class is definitely desirable. Single this one is starting on a fresh slate, it's worth a try.

Comment threadcpp/src/arrow/array.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, I'm a bit disappointed that we aren't deprecating this type =/

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I didn't want to get dragged into what it means deprecate this, should be easy enough to do if we want it. As noted below I tried to say it was optional which I seem to recall seeing this was ok on a previous ML thread.

Comment threadcpp/src/arrow/array/builder_time.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this redundant with type_fwd.h?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, it appears so, I'll push a commit removing them. It looks like there might be more redundancy in builder_primitive.h

Comment threadcpp/src/arrow/builder.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think static_cast (or checked_cast) is sufficient here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

Comment threadcpp/src/arrow/type.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: as far as naming I could see an argument for using

  • interval_duration
  • interval_day_time
  • interval_month

but I'm OK with the way things are here

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I could see this to, but I'm happier without the reverse notation.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

note "duration" conflicts with some of our time classes so I renamed to "duration_type", hopefully that is ok

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"some of our time classes"?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Need to look back I think it was in the vendored time library we were using. I can look deeper if you don't think there should be a conflict

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

looking again they shouldn't conflict, I will try to fix this today.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome, thanks.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

renamed. had to touch some of the vendored code.

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it. If it isn't being deprecated then it's reasonable to implement it in C++ and have integration tests

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm Thanks for the review I'll try to address comments in the next few days. In terms of naming, I don't know the etiquette for changing the name once it gets approved on the ML. If was going to change it, I think Duration would be my choice.

@pravindra already reviewed most of the java code, the main changes that happened where plumbing through support for the integration test.

Comment threadcpp/src/arrow/array/builder_dict.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just for your information.

These changes will be conflicted with #4255.
If #4255 is merged, we will be able to just remove these changes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, they were removed.

@emkornfieldemkornfield changed the title ARROW-835: [Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new Duration typeMay 13, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm I think I addressed all your feedback. The OS/X build seems to in an infinite CMake loop with something like

 the following targets are still affected by RPATH settings:
arrow_python_shared
arrow_shared
arrow_testing_shared
parquet_shared
plasma_shared

I'm not sure why my change would have caused this. Any thoughts?

@pravindra I was able to consolidate all the java vectors into one, could you take a look?

@emkornfield
emkornfieldforce-pushed the new_type branch 2 times, most recently from 2913b09 to 773a2b0CompareMay 15, 2019 19:28
@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Baffling

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

It must have something to do with this being an older PR. Is Appveyor enabled on your fork? If not I can push this to my fork to get an Appveyor build going

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

No appveyor isn't enabled on my fork. let me try squashing everything, see if that helps.

and mark DayTimeInterval as deprecated.
Provides implementation for Duration, DayTimeInterval and YearMonth
interval in C++ and Java (for duration). Adds integration test.
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Ahh, squash seems to have worked, lets hope things stay green.

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

@emkornfield it looks you made some changes to vendored code which I think we should try to avoid doing in general, can we open a JIRA to restore to the vendored version and address the name conflict another way? I don't want this issue to block the patch since I need this to go in and then rebase #4316 on top

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Appveyor appears to be about ~6 hours backed up so I'm going to push a branch on my fork to try to get a quicker thumbs up to merge this

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Here's an Appveyor build starting now on my fork which will take a while to run https://ci.appveyor.com/project/wesm/arrow/builds/24577591

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Thanks. https://issues.apache.org/jira/browse/ARROW-5346 opened to revert the changes. Right now the only solution seems like reordering includes in some cases or fixing upstream. I will have to think about this.

@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Appveyor build looks OK, I'm going to wait a little while yet to make sure the MinGW build works before merging

@emkornfield

emkornfield commented May 16, 2019

Copy link
Copy Markdown
ContributorAuthor

@wesm appveyor on your branch looks all green.

@wesmwesm closed this in 6f80ea4May 16, 2019
@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Awesome. Thanks @emkornfield!!

@emkornfield
emkornfield deleted the new_type branch May 16, 2019 03:19
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
- Create a new DurationInterval type in format.
- Implement all interval types in C++ and Java including integration test.
Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?
Author: Micah Kornfield <emkornfield@gmail.com>
Closesapache#3644 from emkornfield/new_type and squashes the following commits:
cc6d39c <Micah Kornfield> remove system clock
daf8b4f <Micah Kornfield> duration_type->duration
b064816 <Micah Kornfield> Introduce a new Duration type can that represent time deltas, and mark DayTimeInterval as deprecated.
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.

6 participants

@emkornfield@codecov-io@pravindra@wesm@kou@jacques-n
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-835: [Format][C++][Java] Create a new Duration type - #3644

Closed
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type
Closed

ARROW-835: [Format][C++][Java] Create a new Duration type#3644
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type

Conversation

@emkornfield

@emkornfieldemkornfield commented Feb 14, 2019

Copy link
Copy Markdown
Contributor
  • Create a new DurationInterval type in format.
  • Implement all interval types in C++ and Java including integration test.

Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?

@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format] Add time resolution to Interval by creating a new typeARROW-352:[Format] Add time resolution to Interval by creating a new typeFeb 15, 2019
@codecov-io

codecov-io commented Feb 15, 2019

Copy link
Copy Markdown

Codecov Report

Merging #3644 into master will decrease coverage by <.01%.
The diff coverage is 84.24%.

Impacted file tree graph

@@ Coverage Diff @@## master #3644 +/- ##
==========================================
- Coverage 88.07% 88.06% -0.01% 
==========================================
Files 773 774 +1 Lines 96887 97162 +275 Branches 1251 1251 ==========================================
+ Hits 85329 85566 +237 - Misses 11322 11360 +38 
Partials 236 236
Impacted FilesCoverage Δ
cpp/src/arrow/ipc/read-write-test.cc99.81% <ø> (ø)⬆️
cpp/src/arrow/ipc/json-test.cc98.46% <ø> (ø)⬆️
cpp/src/arrow/visitor.h50% <ø> (ø)⬆️
cpp/src/arrow/scalar.h88.23% <ø> (ø)⬆️
cpp/src/arrow/array/builder_primitive.h95.86% <ø> (ø)⬆️
cpp/src/arrow/type_traits.h85.71% <0%> (-7.25%)⬇️
cpp/src/arrow/array/builder_dict.cc86.06% <0%> (-1.44%)⬇️
cpp/src/arrow/pretty_print.cc83.48% <0%> (-1.6%)⬇️
cpp/src/arrow/visitor.cc0% <0%> (ø)⬆️
cpp/src/arrow/type-test.cc99.21% <100%> (+0.05%)⬆️
... and 16 more

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 2ca6fe8...973d80f. Read the comment docs.

Comment threadformat/Schema.fbs Outdated
@emkornfieldemkornfield changed the title ARROW-352:[Format] Add time resolution to Interval by creating a new typeARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeFeb 23, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm could you look at the format changes to see if you are ok with them?
@pravindra Can you look at the impact on the java side (I added all the necessary java classes I think) to confirm this is acceptable for the Java?

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Failure was NodeJs

@koukou changed the title ARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeFeb 24, 2019
@pravindra

Copy link
Copy Markdown
Contributor

since this is a format change (backward compatible though), I'll wait for @wesm to approve too before merging.

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@pravindra thanks for the review

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Looking over the old e-mail threads it might be that TimeDelta or TimestampDelta is a better name for this type?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm based on comments on the other JIRAs CLs it seems like it would be desirable to add an implementation for C++, I can add that to this CL but would you mind taking a look to see if you are ok with naming/modeling (I would prefer not to have to refactor just due to naming issues if possible).

@emkornfieldemkornfield changed the title ARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 12, 2019
@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new DurationInterval typeApr 30, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

I believe the Python on OS/X error is spurious (it was green on previous build).

@wesm

wesm commented May 3, 2019

Copy link
Copy Markdown
Member

Will work on reviewing the C++ side of this

@wesmwesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The C++ side of this, and the changes to the Flatbuffers files, all looks good to me. Thanks @emkornfield for slogging through this and implementing C++, Java, and integration tests in one go!

One question I have is whether we want to commit to the name "DurationInterval" rather than alternatives such as "Duration" or "TimeDelta" or "TimeDuration". I don't think the names are sacred

Can someone (@siddharthteotia ?) carve out a little time to review the Java so we can try to get this merged soon?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think it's possible to collapse this into a single class? There was an effort to do this for Timestamp (with a TimeUnit class) but it failed only because Dremio had taken on dependency with the TimestampUNIT classes

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Potentially, I followed the pattern already established in the codebase, but I'm open to trying if it is desirable. @pravindra@siddharthteotia do you think this is desirable/possible?

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.

Sounds okay to me. Let's see what @siddharthteotia and @pravindra say.

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.

IMO, having a single class is definitely desirable. Single this one is starting on a fresh slate, it's worth a try.

Comment threadcpp/src/arrow/array.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, I'm a bit disappointed that we aren't deprecating this type =/

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I didn't want to get dragged into what it means deprecate this, should be easy enough to do if we want it. As noted below I tried to say it was optional which I seem to recall seeing this was ok on a previous ML thread.

Comment threadcpp/src/arrow/array/builder_time.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this redundant with type_fwd.h?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, it appears so, I'll push a commit removing them. It looks like there might be more redundancy in builder_primitive.h

Comment threadcpp/src/arrow/builder.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think static_cast (or checked_cast) is sufficient here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

Comment threadcpp/src/arrow/type.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: as far as naming I could see an argument for using

  • interval_duration
  • interval_day_time
  • interval_month

but I'm OK with the way things are here

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I could see this to, but I'm happier without the reverse notation.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

note "duration" conflicts with some of our time classes so I renamed to "duration_type", hopefully that is ok

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"some of our time classes"?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Need to look back I think it was in the vendored time library we were using. I can look deeper if you don't think there should be a conflict

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

looking again they shouldn't conflict, I will try to fix this today.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome, thanks.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

renamed. had to touch some of the vendored code.

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it. If it isn't being deprecated then it's reasonable to implement it in C++ and have integration tests

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm Thanks for the review I'll try to address comments in the next few days. In terms of naming, I don't know the etiquette for changing the name once it gets approved on the ML. If was going to change it, I think Duration would be my choice.

@pravindra already reviewed most of the java code, the main changes that happened where plumbing through support for the integration test.

Comment threadcpp/src/arrow/array/builder_dict.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just for your information.

These changes will be conflicted with #4255.
If #4255 is merged, we will be able to just remove these changes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, they were removed.

@emkornfieldemkornfield changed the title ARROW-835: [Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new Duration typeMay 13, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm I think I addressed all your feedback. The OS/X build seems to in an infinite CMake loop with something like

 the following targets are still affected by RPATH settings:
arrow_python_shared
arrow_shared
arrow_testing_shared
parquet_shared
plasma_shared

I'm not sure why my change would have caused this. Any thoughts?

@pravindra I was able to consolidate all the java vectors into one, could you take a look?

@emkornfield
emkornfieldforce-pushed the new_type branch 2 times, most recently from 2913b09 to 773a2b0CompareMay 15, 2019 19:28
@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Baffling

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

It must have something to do with this being an older PR. Is Appveyor enabled on your fork? If not I can push this to my fork to get an Appveyor build going

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

No appveyor isn't enabled on my fork. let me try squashing everything, see if that helps.

and mark DayTimeInterval as deprecated.
Provides implementation for Duration, DayTimeInterval and YearMonth
interval in C++ and Java (for duration). Adds integration test.
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Ahh, squash seems to have worked, lets hope things stay green.

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

@emkornfield it looks you made some changes to vendored code which I think we should try to avoid doing in general, can we open a JIRA to restore to the vendored version and address the name conflict another way? I don't want this issue to block the patch since I need this to go in and then rebase #4316 on top

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Appveyor appears to be about ~6 hours backed up so I'm going to push a branch on my fork to try to get a quicker thumbs up to merge this

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Here's an Appveyor build starting now on my fork which will take a while to run https://ci.appveyor.com/project/wesm/arrow/builds/24577591

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Thanks. https://issues.apache.org/jira/browse/ARROW-5346 opened to revert the changes. Right now the only solution seems like reordering includes in some cases or fixing upstream. I will have to think about this.

@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Appveyor build looks OK, I'm going to wait a little while yet to make sure the MinGW build works before merging

@emkornfield

emkornfield commented May 16, 2019

Copy link
Copy Markdown
ContributorAuthor

@wesm appveyor on your branch looks all green.

@wesmwesm closed this in 6f80ea4May 16, 2019
@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Awesome. Thanks @emkornfield!!

@emkornfield
emkornfield deleted the new_type branch May 16, 2019 03:19
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
- Create a new DurationInterval type in format.
- Implement all interval types in C++ and Java including integration test.
Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?
Author: Micah Kornfield <emkornfield@gmail.com>
Closesapache#3644 from emkornfield/new_type and squashes the following commits:
cc6d39c <Micah Kornfield> remove system clock
daf8b4f <Micah Kornfield> duration_type->duration
b064816 <Micah Kornfield> Introduce a new Duration type can that represent time deltas, and mark DayTimeInterval as deprecated.
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.

6 participants

@emkornfield@codecov-io@pravindra@wesm@kou@jacques-n
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-835: [Format][C++][Java] Create a new Duration type - #3644

Closed
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type
Closed

ARROW-835: [Format][C++][Java] Create a new Duration type#3644
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type

Conversation

@emkornfield

@emkornfieldemkornfield commented Feb 14, 2019

Copy link
Copy Markdown
Contributor
  • Create a new DurationInterval type in format.
  • Implement all interval types in C++ and Java including integration test.

Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?

@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format] Add time resolution to Interval by creating a new typeARROW-352:[Format] Add time resolution to Interval by creating a new typeFeb 15, 2019
@codecov-io

codecov-io commented Feb 15, 2019

Copy link
Copy Markdown

Codecov Report

Merging #3644 into master will decrease coverage by <.01%.
The diff coverage is 84.24%.

Impacted file tree graph

@@ Coverage Diff @@## master #3644 +/- ##
==========================================
- Coverage 88.07% 88.06% -0.01% 
==========================================
Files 773 774 +1 Lines 96887 97162 +275 Branches 1251 1251 ==========================================
+ Hits 85329 85566 +237 - Misses 11322 11360 +38 
Partials 236 236
Impacted FilesCoverage Δ
cpp/src/arrow/ipc/read-write-test.cc99.81% <ø> (ø)⬆️
cpp/src/arrow/ipc/json-test.cc98.46% <ø> (ø)⬆️
cpp/src/arrow/visitor.h50% <ø> (ø)⬆️
cpp/src/arrow/scalar.h88.23% <ø> (ø)⬆️
cpp/src/arrow/array/builder_primitive.h95.86% <ø> (ø)⬆️
cpp/src/arrow/type_traits.h85.71% <0%> (-7.25%)⬇️
cpp/src/arrow/array/builder_dict.cc86.06% <0%> (-1.44%)⬇️
cpp/src/arrow/pretty_print.cc83.48% <0%> (-1.6%)⬇️
cpp/src/arrow/visitor.cc0% <0%> (ø)⬆️
cpp/src/arrow/type-test.cc99.21% <100%> (+0.05%)⬆️
... and 16 more

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 2ca6fe8...973d80f. Read the comment docs.

Comment threadformat/Schema.fbs Outdated
@emkornfieldemkornfield changed the title ARROW-352:[Format] Add time resolution to Interval by creating a new typeARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeFeb 23, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm could you look at the format changes to see if you are ok with them?
@pravindra Can you look at the impact on the java side (I added all the necessary java classes I think) to confirm this is acceptable for the Java?

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Failure was NodeJs

@koukou changed the title ARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeFeb 24, 2019
@pravindra

Copy link
Copy Markdown
Contributor

since this is a format change (backward compatible though), I'll wait for @wesm to approve too before merging.

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@pravindra thanks for the review

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Looking over the old e-mail threads it might be that TimeDelta or TimestampDelta is a better name for this type?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm based on comments on the other JIRAs CLs it seems like it would be desirable to add an implementation for C++, I can add that to this CL but would you mind taking a look to see if you are ok with naming/modeling (I would prefer not to have to refactor just due to naming issues if possible).

@emkornfieldemkornfield changed the title ARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 12, 2019
@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new DurationInterval typeApr 30, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

I believe the Python on OS/X error is spurious (it was green on previous build).

@wesm

wesm commented May 3, 2019

Copy link
Copy Markdown
Member

Will work on reviewing the C++ side of this

@wesmwesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The C++ side of this, and the changes to the Flatbuffers files, all looks good to me. Thanks @emkornfield for slogging through this and implementing C++, Java, and integration tests in one go!

One question I have is whether we want to commit to the name "DurationInterval" rather than alternatives such as "Duration" or "TimeDelta" or "TimeDuration". I don't think the names are sacred

Can someone (@siddharthteotia ?) carve out a little time to review the Java so we can try to get this merged soon?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think it's possible to collapse this into a single class? There was an effort to do this for Timestamp (with a TimeUnit class) but it failed only because Dremio had taken on dependency with the TimestampUNIT classes

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Potentially, I followed the pattern already established in the codebase, but I'm open to trying if it is desirable. @pravindra@siddharthteotia do you think this is desirable/possible?

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.

Sounds okay to me. Let's see what @siddharthteotia and @pravindra say.

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.

IMO, having a single class is definitely desirable. Single this one is starting on a fresh slate, it's worth a try.

Comment threadcpp/src/arrow/array.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, I'm a bit disappointed that we aren't deprecating this type =/

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I didn't want to get dragged into what it means deprecate this, should be easy enough to do if we want it. As noted below I tried to say it was optional which I seem to recall seeing this was ok on a previous ML thread.

Comment threadcpp/src/arrow/array/builder_time.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this redundant with type_fwd.h?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, it appears so, I'll push a commit removing them. It looks like there might be more redundancy in builder_primitive.h

Comment threadcpp/src/arrow/builder.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think static_cast (or checked_cast) is sufficient here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

Comment threadcpp/src/arrow/type.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: as far as naming I could see an argument for using

  • interval_duration
  • interval_day_time
  • interval_month

but I'm OK with the way things are here

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I could see this to, but I'm happier without the reverse notation.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

note "duration" conflicts with some of our time classes so I renamed to "duration_type", hopefully that is ok

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"some of our time classes"?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Need to look back I think it was in the vendored time library we were using. I can look deeper if you don't think there should be a conflict

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

looking again they shouldn't conflict, I will try to fix this today.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome, thanks.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

renamed. had to touch some of the vendored code.

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it. If it isn't being deprecated then it's reasonable to implement it in C++ and have integration tests

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm Thanks for the review I'll try to address comments in the next few days. In terms of naming, I don't know the etiquette for changing the name once it gets approved on the ML. If was going to change it, I think Duration would be my choice.

@pravindra already reviewed most of the java code, the main changes that happened where plumbing through support for the integration test.

Comment threadcpp/src/arrow/array/builder_dict.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just for your information.

These changes will be conflicted with #4255.
If #4255 is merged, we will be able to just remove these changes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, they were removed.

@emkornfieldemkornfield changed the title ARROW-835: [Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new Duration typeMay 13, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm I think I addressed all your feedback. The OS/X build seems to in an infinite CMake loop with something like

 the following targets are still affected by RPATH settings:
arrow_python_shared
arrow_shared
arrow_testing_shared
parquet_shared
plasma_shared

I'm not sure why my change would have caused this. Any thoughts?

@pravindra I was able to consolidate all the java vectors into one, could you take a look?

@emkornfield
emkornfieldforce-pushed the new_type branch 2 times, most recently from 2913b09 to 773a2b0CompareMay 15, 2019 19:28
@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Baffling

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

It must have something to do with this being an older PR. Is Appveyor enabled on your fork? If not I can push this to my fork to get an Appveyor build going

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

No appveyor isn't enabled on my fork. let me try squashing everything, see if that helps.

and mark DayTimeInterval as deprecated.
Provides implementation for Duration, DayTimeInterval and YearMonth
interval in C++ and Java (for duration). Adds integration test.
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Ahh, squash seems to have worked, lets hope things stay green.

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

@emkornfield it looks you made some changes to vendored code which I think we should try to avoid doing in general, can we open a JIRA to restore to the vendored version and address the name conflict another way? I don't want this issue to block the patch since I need this to go in and then rebase #4316 on top

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Appveyor appears to be about ~6 hours backed up so I'm going to push a branch on my fork to try to get a quicker thumbs up to merge this

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Here's an Appveyor build starting now on my fork which will take a while to run https://ci.appveyor.com/project/wesm/arrow/builds/24577591

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Thanks. https://issues.apache.org/jira/browse/ARROW-5346 opened to revert the changes. Right now the only solution seems like reordering includes in some cases or fixing upstream. I will have to think about this.

@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Appveyor build looks OK, I'm going to wait a little while yet to make sure the MinGW build works before merging

@emkornfield

emkornfield commented May 16, 2019

Copy link
Copy Markdown
ContributorAuthor

@wesm appveyor on your branch looks all green.

@wesmwesm closed this in 6f80ea4May 16, 2019
@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Awesome. Thanks @emkornfield!!

@emkornfield
emkornfield deleted the new_type branch May 16, 2019 03:19
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
- Create a new DurationInterval type in format.
- Implement all interval types in C++ and Java including integration test.
Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?
Author: Micah Kornfield <emkornfield@gmail.com>
Closesapache#3644 from emkornfield/new_type and squashes the following commits:
cc6d39c <Micah Kornfield> remove system clock
daf8b4f <Micah Kornfield> duration_type->duration
b064816 <Micah Kornfield> Introduce a new Duration type can that represent time deltas, and mark DayTimeInterval as deprecated.
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.

6 participants

@emkornfield@codecov-io@pravindra@wesm@kou@jacques-n
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

ARROW-835: [Format][C++][Java] Create a new Duration type - #3644

Closed
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type
Closed

ARROW-835: [Format][C++][Java] Create a new Duration type#3644
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type

Conversation

@emkornfield

@emkornfieldemkornfield commented Feb 14, 2019

Copy link
Copy Markdown
Contributor
  • Create a new DurationInterval type in format.
  • Implement all interval types in C++ and Java including integration test.

Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?

@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format] Add time resolution to Interval by creating a new typeARROW-352:[Format] Add time resolution to Interval by creating a new typeFeb 15, 2019
@codecov-io

codecov-io commented Feb 15, 2019

Copy link
Copy Markdown

Codecov Report

Merging #3644 into master will decrease coverage by <.01%.
The diff coverage is 84.24%.

Impacted file tree graph

@@ Coverage Diff @@## master #3644 +/- ##
==========================================
- Coverage 88.07% 88.06% -0.01% 
==========================================
Files 773 774 +1 Lines 96887 97162 +275 Branches 1251 1251 ==========================================
+ Hits 85329 85566 +237 - Misses 11322 11360 +38 
Partials 236 236
Impacted FilesCoverage Δ
cpp/src/arrow/ipc/read-write-test.cc99.81% <ø> (ø)⬆️
cpp/src/arrow/ipc/json-test.cc98.46% <ø> (ø)⬆️
cpp/src/arrow/visitor.h50% <ø> (ø)⬆️
cpp/src/arrow/scalar.h88.23% <ø> (ø)⬆️
cpp/src/arrow/array/builder_primitive.h95.86% <ø> (ø)⬆️
cpp/src/arrow/type_traits.h85.71% <0%> (-7.25%)⬇️
cpp/src/arrow/array/builder_dict.cc86.06% <0%> (-1.44%)⬇️
cpp/src/arrow/pretty_print.cc83.48% <0%> (-1.6%)⬇️
cpp/src/arrow/visitor.cc0% <0%> (ø)⬆️
cpp/src/arrow/type-test.cc99.21% <100%> (+0.05%)⬆️
... and 16 more

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 2ca6fe8...973d80f. Read the comment docs.

Comment threadformat/Schema.fbs Outdated
@emkornfieldemkornfield changed the title ARROW-352:[Format] Add time resolution to Interval by creating a new typeARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeFeb 23, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm could you look at the format changes to see if you are ok with them?
@pravindra Can you look at the impact on the java side (I added all the necessary java classes I think) to confirm this is acceptable for the Java?

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Failure was NodeJs

@koukou changed the title ARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeFeb 24, 2019
@pravindra

Copy link
Copy Markdown
Contributor

since this is a format change (backward compatible though), I'll wait for @wesm to approve too before merging.

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@pravindra thanks for the review

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Looking over the old e-mail threads it might be that TimeDelta or TimestampDelta is a better name for this type?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm based on comments on the other JIRAs CLs it seems like it would be desirable to add an implementation for C++, I can add that to this CL but would you mind taking a look to see if you are ok with naming/modeling (I would prefer not to have to refactor just due to naming issues if possible).

@emkornfieldemkornfield changed the title ARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 12, 2019
@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new DurationInterval typeApr 30, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

I believe the Python on OS/X error is spurious (it was green on previous build).

@wesm

wesm commented May 3, 2019

Copy link
Copy Markdown
Member

Will work on reviewing the C++ side of this

@wesmwesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The C++ side of this, and the changes to the Flatbuffers files, all looks good to me. Thanks @emkornfield for slogging through this and implementing C++, Java, and integration tests in one go!

One question I have is whether we want to commit to the name "DurationInterval" rather than alternatives such as "Duration" or "TimeDelta" or "TimeDuration". I don't think the names are sacred

Can someone (@siddharthteotia ?) carve out a little time to review the Java so we can try to get this merged soon?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think it's possible to collapse this into a single class? There was an effort to do this for Timestamp (with a TimeUnit class) but it failed only because Dremio had taken on dependency with the TimestampUNIT classes

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Potentially, I followed the pattern already established in the codebase, but I'm open to trying if it is desirable. @pravindra@siddharthteotia do you think this is desirable/possible?

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.

Sounds okay to me. Let's see what @siddharthteotia and @pravindra say.

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.

IMO, having a single class is definitely desirable. Single this one is starting on a fresh slate, it's worth a try.

Comment threadcpp/src/arrow/array.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, I'm a bit disappointed that we aren't deprecating this type =/

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I didn't want to get dragged into what it means deprecate this, should be easy enough to do if we want it. As noted below I tried to say it was optional which I seem to recall seeing this was ok on a previous ML thread.

Comment threadcpp/src/arrow/array/builder_time.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this redundant with type_fwd.h?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, it appears so, I'll push a commit removing them. It looks like there might be more redundancy in builder_primitive.h

Comment threadcpp/src/arrow/builder.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think static_cast (or checked_cast) is sufficient here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

Comment threadcpp/src/arrow/type.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: as far as naming I could see an argument for using

  • interval_duration
  • interval_day_time
  • interval_month

but I'm OK with the way things are here

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I could see this to, but I'm happier without the reverse notation.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

note "duration" conflicts with some of our time classes so I renamed to "duration_type", hopefully that is ok

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"some of our time classes"?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Need to look back I think it was in the vendored time library we were using. I can look deeper if you don't think there should be a conflict

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

looking again they shouldn't conflict, I will try to fix this today.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome, thanks.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

renamed. had to touch some of the vendored code.

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it. If it isn't being deprecated then it's reasonable to implement it in C++ and have integration tests

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm Thanks for the review I'll try to address comments in the next few days. In terms of naming, I don't know the etiquette for changing the name once it gets approved on the ML. If was going to change it, I think Duration would be my choice.

@pravindra already reviewed most of the java code, the main changes that happened where plumbing through support for the integration test.

Comment threadcpp/src/arrow/array/builder_dict.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just for your information.

These changes will be conflicted with #4255.
If #4255 is merged, we will be able to just remove these changes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, they were removed.

@emkornfieldemkornfield changed the title ARROW-835: [Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new Duration typeMay 13, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm I think I addressed all your feedback. The OS/X build seems to in an infinite CMake loop with something like

 the following targets are still affected by RPATH settings:
arrow_python_shared
arrow_shared
arrow_testing_shared
parquet_shared
plasma_shared

I'm not sure why my change would have caused this. Any thoughts?

@pravindra I was able to consolidate all the java vectors into one, could you take a look?

@emkornfield
emkornfieldforce-pushed the new_type branch 2 times, most recently from 2913b09 to 773a2b0CompareMay 15, 2019 19:28
@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Baffling

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

It must have something to do with this being an older PR. Is Appveyor enabled on your fork? If not I can push this to my fork to get an Appveyor build going

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

No appveyor isn't enabled on my fork. let me try squashing everything, see if that helps.

and mark DayTimeInterval as deprecated.
Provides implementation for Duration, DayTimeInterval and YearMonth
interval in C++ and Java (for duration). Adds integration test.
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Ahh, squash seems to have worked, lets hope things stay green.

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

@emkornfield it looks you made some changes to vendored code which I think we should try to avoid doing in general, can we open a JIRA to restore to the vendored version and address the name conflict another way? I don't want this issue to block the patch since I need this to go in and then rebase #4316 on top

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Appveyor appears to be about ~6 hours backed up so I'm going to push a branch on my fork to try to get a quicker thumbs up to merge this

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Here's an Appveyor build starting now on my fork which will take a while to run https://ci.appveyor.com/project/wesm/arrow/builds/24577591

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Thanks. https://issues.apache.org/jira/browse/ARROW-5346 opened to revert the changes. Right now the only solution seems like reordering includes in some cases or fixing upstream. I will have to think about this.

@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Appveyor build looks OK, I'm going to wait a little while yet to make sure the MinGW build works before merging

@emkornfield

emkornfield commented May 16, 2019

Copy link
Copy Markdown
ContributorAuthor

@wesm appveyor on your branch looks all green.

@wesmwesm closed this in 6f80ea4May 16, 2019
@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Awesome. Thanks @emkornfield!!

@emkornfield
emkornfield deleted the new_type branch May 16, 2019 03:19
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
- Create a new DurationInterval type in format.
- Implement all interval types in C++ and Java including integration test.
Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?
Author: Micah Kornfield <emkornfield@gmail.com>
Closesapache#3644 from emkornfield/new_type and squashes the following commits:
cc6d39c <Micah Kornfield> remove system clock
daf8b4f <Micah Kornfield> duration_type->duration
b064816 <Micah Kornfield> Introduce a new Duration type can that represent time deltas, and mark DayTimeInterval as deprecated.
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.

6 participants

@emkornfield@codecov-io@pravindra@wesm@kou@jacques-n
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-835: [Format][C++][Java] Create a new Duration type - #3644

Closed
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type
Closed

ARROW-835: [Format][C++][Java] Create a new Duration type#3644
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type

Conversation

@emkornfield

@emkornfieldemkornfield commented Feb 14, 2019

Copy link
Copy Markdown
Contributor
  • Create a new DurationInterval type in format.
  • Implement all interval types in C++ and Java including integration test.

Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?

@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format] Add time resolution to Interval by creating a new typeARROW-352:[Format] Add time resolution to Interval by creating a new typeFeb 15, 2019
@codecov-io

codecov-io commented Feb 15, 2019

Copy link
Copy Markdown

Codecov Report

Merging #3644 into master will decrease coverage by <.01%.
The diff coverage is 84.24%.

Impacted file tree graph

@@ Coverage Diff @@## master #3644 +/- ##
==========================================
- Coverage 88.07% 88.06% -0.01% 
==========================================
Files 773 774 +1 Lines 96887 97162 +275 Branches 1251 1251 ==========================================
+ Hits 85329 85566 +237 - Misses 11322 11360 +38 
Partials 236 236
Impacted FilesCoverage Δ
cpp/src/arrow/ipc/read-write-test.cc99.81% <ø> (ø)⬆️
cpp/src/arrow/ipc/json-test.cc98.46% <ø> (ø)⬆️
cpp/src/arrow/visitor.h50% <ø> (ø)⬆️
cpp/src/arrow/scalar.h88.23% <ø> (ø)⬆️
cpp/src/arrow/array/builder_primitive.h95.86% <ø> (ø)⬆️
cpp/src/arrow/type_traits.h85.71% <0%> (-7.25%)⬇️
cpp/src/arrow/array/builder_dict.cc86.06% <0%> (-1.44%)⬇️
cpp/src/arrow/pretty_print.cc83.48% <0%> (-1.6%)⬇️
cpp/src/arrow/visitor.cc0% <0%> (ø)⬆️
cpp/src/arrow/type-test.cc99.21% <100%> (+0.05%)⬆️
... and 16 more

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 2ca6fe8...973d80f. Read the comment docs.

Comment threadformat/Schema.fbs Outdated
@emkornfieldemkornfield changed the title ARROW-352:[Format] Add time resolution to Interval by creating a new typeARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeFeb 23, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm could you look at the format changes to see if you are ok with them?
@pravindra Can you look at the impact on the java side (I added all the necessary java classes I think) to confirm this is acceptable for the Java?

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Failure was NodeJs

@koukou changed the title ARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeFeb 24, 2019
@pravindra

Copy link
Copy Markdown
Contributor

since this is a format change (backward compatible though), I'll wait for @wesm to approve too before merging.

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@pravindra thanks for the review

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Looking over the old e-mail threads it might be that TimeDelta or TimestampDelta is a better name for this type?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm based on comments on the other JIRAs CLs it seems like it would be desirable to add an implementation for C++, I can add that to this CL but would you mind taking a look to see if you are ok with naming/modeling (I would prefer not to have to refactor just due to naming issues if possible).

@emkornfieldemkornfield changed the title ARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 12, 2019
@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new DurationInterval typeApr 30, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

I believe the Python on OS/X error is spurious (it was green on previous build).

@wesm

wesm commented May 3, 2019

Copy link
Copy Markdown
Member

Will work on reviewing the C++ side of this

@wesmwesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The C++ side of this, and the changes to the Flatbuffers files, all looks good to me. Thanks @emkornfield for slogging through this and implementing C++, Java, and integration tests in one go!

One question I have is whether we want to commit to the name "DurationInterval" rather than alternatives such as "Duration" or "TimeDelta" or "TimeDuration". I don't think the names are sacred

Can someone (@siddharthteotia ?) carve out a little time to review the Java so we can try to get this merged soon?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think it's possible to collapse this into a single class? There was an effort to do this for Timestamp (with a TimeUnit class) but it failed only because Dremio had taken on dependency with the TimestampUNIT classes

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Potentially, I followed the pattern already established in the codebase, but I'm open to trying if it is desirable. @pravindra@siddharthteotia do you think this is desirable/possible?

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.

Sounds okay to me. Let's see what @siddharthteotia and @pravindra say.

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.

IMO, having a single class is definitely desirable. Single this one is starting on a fresh slate, it's worth a try.

Comment threadcpp/src/arrow/array.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, I'm a bit disappointed that we aren't deprecating this type =/

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I didn't want to get dragged into what it means deprecate this, should be easy enough to do if we want it. As noted below I tried to say it was optional which I seem to recall seeing this was ok on a previous ML thread.

Comment threadcpp/src/arrow/array/builder_time.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this redundant with type_fwd.h?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, it appears so, I'll push a commit removing them. It looks like there might be more redundancy in builder_primitive.h

Comment threadcpp/src/arrow/builder.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think static_cast (or checked_cast) is sufficient here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

Comment threadcpp/src/arrow/type.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: as far as naming I could see an argument for using

  • interval_duration
  • interval_day_time
  • interval_month

but I'm OK with the way things are here

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I could see this to, but I'm happier without the reverse notation.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

note "duration" conflicts with some of our time classes so I renamed to "duration_type", hopefully that is ok

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"some of our time classes"?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Need to look back I think it was in the vendored time library we were using. I can look deeper if you don't think there should be a conflict

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

looking again they shouldn't conflict, I will try to fix this today.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome, thanks.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

renamed. had to touch some of the vendored code.

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it. If it isn't being deprecated then it's reasonable to implement it in C++ and have integration tests

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm Thanks for the review I'll try to address comments in the next few days. In terms of naming, I don't know the etiquette for changing the name once it gets approved on the ML. If was going to change it, I think Duration would be my choice.

@pravindra already reviewed most of the java code, the main changes that happened where plumbing through support for the integration test.

Comment threadcpp/src/arrow/array/builder_dict.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just for your information.

These changes will be conflicted with #4255.
If #4255 is merged, we will be able to just remove these changes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, they were removed.

@emkornfieldemkornfield changed the title ARROW-835: [Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new Duration typeMay 13, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm I think I addressed all your feedback. The OS/X build seems to in an infinite CMake loop with something like

 the following targets are still affected by RPATH settings:
arrow_python_shared
arrow_shared
arrow_testing_shared
parquet_shared
plasma_shared

I'm not sure why my change would have caused this. Any thoughts?

@pravindra I was able to consolidate all the java vectors into one, could you take a look?

@emkornfield
emkornfieldforce-pushed the new_type branch 2 times, most recently from 2913b09 to 773a2b0CompareMay 15, 2019 19:28
@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Baffling

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

It must have something to do with this being an older PR. Is Appveyor enabled on your fork? If not I can push this to my fork to get an Appveyor build going

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

No appveyor isn't enabled on my fork. let me try squashing everything, see if that helps.

and mark DayTimeInterval as deprecated.
Provides implementation for Duration, DayTimeInterval and YearMonth
interval in C++ and Java (for duration). Adds integration test.
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Ahh, squash seems to have worked, lets hope things stay green.

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

@emkornfield it looks you made some changes to vendored code which I think we should try to avoid doing in general, can we open a JIRA to restore to the vendored version and address the name conflict another way? I don't want this issue to block the patch since I need this to go in and then rebase #4316 on top

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Appveyor appears to be about ~6 hours backed up so I'm going to push a branch on my fork to try to get a quicker thumbs up to merge this

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Here's an Appveyor build starting now on my fork which will take a while to run https://ci.appveyor.com/project/wesm/arrow/builds/24577591

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Thanks. https://issues.apache.org/jira/browse/ARROW-5346 opened to revert the changes. Right now the only solution seems like reordering includes in some cases or fixing upstream. I will have to think about this.

@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Appveyor build looks OK, I'm going to wait a little while yet to make sure the MinGW build works before merging

@emkornfield

emkornfield commented May 16, 2019

Copy link
Copy Markdown
ContributorAuthor

@wesm appveyor on your branch looks all green.

@wesmwesm closed this in 6f80ea4May 16, 2019
@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Awesome. Thanks @emkornfield!!

@emkornfield
emkornfield deleted the new_type branch May 16, 2019 03:19
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
- Create a new DurationInterval type in format.
- Implement all interval types in C++ and Java including integration test.
Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?
Author: Micah Kornfield <emkornfield@gmail.com>
Closesapache#3644 from emkornfield/new_type and squashes the following commits:
cc6d39c <Micah Kornfield> remove system clock
daf8b4f <Micah Kornfield> duration_type->duration
b064816 <Micah Kornfield> Introduce a new Duration type can that represent time deltas, and mark DayTimeInterval as deprecated.
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.

6 participants

@emkornfield@codecov-io@pravindra@wesm@kou@jacques-n
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

ARROW-835: [Format][C++][Java] Create a new Duration type - #3644

Closed
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type
Closed

ARROW-835: [Format][C++][Java] Create a new Duration type#3644
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type

Conversation

@emkornfield

@emkornfieldemkornfield commented Feb 14, 2019

Copy link
Copy Markdown
Contributor
  • Create a new DurationInterval type in format.
  • Implement all interval types in C++ and Java including integration test.

Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?

@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format] Add time resolution to Interval by creating a new typeARROW-352:[Format] Add time resolution to Interval by creating a new typeFeb 15, 2019
@codecov-io

codecov-io commented Feb 15, 2019

Copy link
Copy Markdown

Codecov Report

Merging #3644 into master will decrease coverage by <.01%.
The diff coverage is 84.24%.

Impacted file tree graph

@@ Coverage Diff @@## master #3644 +/- ##
==========================================
- Coverage 88.07% 88.06% -0.01% 
==========================================
Files 773 774 +1 Lines 96887 97162 +275 Branches 1251 1251 ==========================================
+ Hits 85329 85566 +237 - Misses 11322 11360 +38 
Partials 236 236
Impacted FilesCoverage Δ
cpp/src/arrow/ipc/read-write-test.cc99.81% <ø> (ø)⬆️
cpp/src/arrow/ipc/json-test.cc98.46% <ø> (ø)⬆️
cpp/src/arrow/visitor.h50% <ø> (ø)⬆️
cpp/src/arrow/scalar.h88.23% <ø> (ø)⬆️
cpp/src/arrow/array/builder_primitive.h95.86% <ø> (ø)⬆️
cpp/src/arrow/type_traits.h85.71% <0%> (-7.25%)⬇️
cpp/src/arrow/array/builder_dict.cc86.06% <0%> (-1.44%)⬇️
cpp/src/arrow/pretty_print.cc83.48% <0%> (-1.6%)⬇️
cpp/src/arrow/visitor.cc0% <0%> (ø)⬆️
cpp/src/arrow/type-test.cc99.21% <100%> (+0.05%)⬆️
... and 16 more

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 2ca6fe8...973d80f. Read the comment docs.

Comment threadformat/Schema.fbs Outdated
@emkornfieldemkornfield changed the title ARROW-352:[Format] Add time resolution to Interval by creating a new typeARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeFeb 23, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm could you look at the format changes to see if you are ok with them?
@pravindra Can you look at the impact on the java side (I added all the necessary java classes I think) to confirm this is acceptable for the Java?

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Failure was NodeJs

@koukou changed the title ARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeFeb 24, 2019
@pravindra

Copy link
Copy Markdown
Contributor

since this is a format change (backward compatible though), I'll wait for @wesm to approve too before merging.

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@pravindra thanks for the review

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Looking over the old e-mail threads it might be that TimeDelta or TimestampDelta is a better name for this type?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm based on comments on the other JIRAs CLs it seems like it would be desirable to add an implementation for C++, I can add that to this CL but would you mind taking a look to see if you are ok with naming/modeling (I would prefer not to have to refactor just due to naming issues if possible).

@emkornfieldemkornfield changed the title ARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 12, 2019
@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new DurationInterval typeApr 30, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

I believe the Python on OS/X error is spurious (it was green on previous build).

@wesm

wesm commented May 3, 2019

Copy link
Copy Markdown
Member

Will work on reviewing the C++ side of this

@wesmwesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The C++ side of this, and the changes to the Flatbuffers files, all looks good to me. Thanks @emkornfield for slogging through this and implementing C++, Java, and integration tests in one go!

One question I have is whether we want to commit to the name "DurationInterval" rather than alternatives such as "Duration" or "TimeDelta" or "TimeDuration". I don't think the names are sacred

Can someone (@siddharthteotia ?) carve out a little time to review the Java so we can try to get this merged soon?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think it's possible to collapse this into a single class? There was an effort to do this for Timestamp (with a TimeUnit class) but it failed only because Dremio had taken on dependency with the TimestampUNIT classes

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Potentially, I followed the pattern already established in the codebase, but I'm open to trying if it is desirable. @pravindra@siddharthteotia do you think this is desirable/possible?

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.

Sounds okay to me. Let's see what @siddharthteotia and @pravindra say.

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.

IMO, having a single class is definitely desirable. Single this one is starting on a fresh slate, it's worth a try.

Comment threadcpp/src/arrow/array.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, I'm a bit disappointed that we aren't deprecating this type =/

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I didn't want to get dragged into what it means deprecate this, should be easy enough to do if we want it. As noted below I tried to say it was optional which I seem to recall seeing this was ok on a previous ML thread.

Comment threadcpp/src/arrow/array/builder_time.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this redundant with type_fwd.h?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, it appears so, I'll push a commit removing them. It looks like there might be more redundancy in builder_primitive.h

Comment threadcpp/src/arrow/builder.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think static_cast (or checked_cast) is sufficient here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

Comment threadcpp/src/arrow/type.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: as far as naming I could see an argument for using

  • interval_duration
  • interval_day_time
  • interval_month

but I'm OK with the way things are here

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I could see this to, but I'm happier without the reverse notation.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

note "duration" conflicts with some of our time classes so I renamed to "duration_type", hopefully that is ok

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"some of our time classes"?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Need to look back I think it was in the vendored time library we were using. I can look deeper if you don't think there should be a conflict

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

looking again they shouldn't conflict, I will try to fix this today.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome, thanks.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

renamed. had to touch some of the vendored code.

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it. If it isn't being deprecated then it's reasonable to implement it in C++ and have integration tests

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm Thanks for the review I'll try to address comments in the next few days. In terms of naming, I don't know the etiquette for changing the name once it gets approved on the ML. If was going to change it, I think Duration would be my choice.

@pravindra already reviewed most of the java code, the main changes that happened where plumbing through support for the integration test.

Comment threadcpp/src/arrow/array/builder_dict.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just for your information.

These changes will be conflicted with #4255.
If #4255 is merged, we will be able to just remove these changes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, they were removed.

@emkornfieldemkornfield changed the title ARROW-835: [Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new Duration typeMay 13, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm I think I addressed all your feedback. The OS/X build seems to in an infinite CMake loop with something like

 the following targets are still affected by RPATH settings:
arrow_python_shared
arrow_shared
arrow_testing_shared
parquet_shared
plasma_shared

I'm not sure why my change would have caused this. Any thoughts?

@pravindra I was able to consolidate all the java vectors into one, could you take a look?

@emkornfield
emkornfieldforce-pushed the new_type branch 2 times, most recently from 2913b09 to 773a2b0CompareMay 15, 2019 19:28
@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Baffling

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

It must have something to do with this being an older PR. Is Appveyor enabled on your fork? If not I can push this to my fork to get an Appveyor build going

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

No appveyor isn't enabled on my fork. let me try squashing everything, see if that helps.

and mark DayTimeInterval as deprecated.
Provides implementation for Duration, DayTimeInterval and YearMonth
interval in C++ and Java (for duration). Adds integration test.
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Ahh, squash seems to have worked, lets hope things stay green.

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

@emkornfield it looks you made some changes to vendored code which I think we should try to avoid doing in general, can we open a JIRA to restore to the vendored version and address the name conflict another way? I don't want this issue to block the patch since I need this to go in and then rebase #4316 on top

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Appveyor appears to be about ~6 hours backed up so I'm going to push a branch on my fork to try to get a quicker thumbs up to merge this

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Here's an Appveyor build starting now on my fork which will take a while to run https://ci.appveyor.com/project/wesm/arrow/builds/24577591

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Thanks. https://issues.apache.org/jira/browse/ARROW-5346 opened to revert the changes. Right now the only solution seems like reordering includes in some cases or fixing upstream. I will have to think about this.

@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Appveyor build looks OK, I'm going to wait a little while yet to make sure the MinGW build works before merging

@emkornfield

emkornfield commented May 16, 2019

Copy link
Copy Markdown
ContributorAuthor

@wesm appveyor on your branch looks all green.

@wesmwesm closed this in 6f80ea4May 16, 2019
@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Awesome. Thanks @emkornfield!!

@emkornfield
emkornfield deleted the new_type branch May 16, 2019 03:19
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
- Create a new DurationInterval type in format.
- Implement all interval types in C++ and Java including integration test.
Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?
Author: Micah Kornfield <emkornfield@gmail.com>
Closesapache#3644 from emkornfield/new_type and squashes the following commits:
cc6d39c <Micah Kornfield> remove system clock
daf8b4f <Micah Kornfield> duration_type->duration
b064816 <Micah Kornfield> Introduce a new Duration type can that represent time deltas, and mark DayTimeInterval as deprecated.
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.

6 participants

@emkornfield@codecov-io@pravindra@wesm@kou@jacques-n
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

ARROW-835: [Format][C++][Java] Create a new Duration type - #3644

Closed
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type
Closed

ARROW-835: [Format][C++][Java] Create a new Duration type#3644
emkornfield wants to merge 3 commits into
apache:masterfrom
emkornfield:new_type

Conversation

@emkornfield

@emkornfieldemkornfield commented Feb 14, 2019

Copy link
Copy Markdown
Contributor
  • Create a new DurationInterval type in format.
  • Implement all interval types in C++ and Java including integration test.

Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?

@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format] Add time resolution to Interval by creating a new typeARROW-352:[Format] Add time resolution to Interval by creating a new typeFeb 15, 2019
@codecov-io

codecov-io commented Feb 15, 2019

Copy link
Copy Markdown

Codecov Report

Merging #3644 into master will decrease coverage by <.01%.
The diff coverage is 84.24%.

Impacted file tree graph

@@ Coverage Diff @@## master #3644 +/- ##
==========================================
- Coverage 88.07% 88.06% -0.01% 
==========================================
Files 773 774 +1 Lines 96887 97162 +275 Branches 1251 1251 ==========================================
+ Hits 85329 85566 +237 - Misses 11322 11360 +38 
Partials 236 236
Impacted FilesCoverage Δ
cpp/src/arrow/ipc/read-write-test.cc99.81% <ø> (ø)⬆️
cpp/src/arrow/ipc/json-test.cc98.46% <ø> (ø)⬆️
cpp/src/arrow/visitor.h50% <ø> (ø)⬆️
cpp/src/arrow/scalar.h88.23% <ø> (ø)⬆️
cpp/src/arrow/array/builder_primitive.h95.86% <ø> (ø)⬆️
cpp/src/arrow/type_traits.h85.71% <0%> (-7.25%)⬇️
cpp/src/arrow/array/builder_dict.cc86.06% <0%> (-1.44%)⬇️
cpp/src/arrow/pretty_print.cc83.48% <0%> (-1.6%)⬇️
cpp/src/arrow/visitor.cc0% <0%> (ø)⬆️
cpp/src/arrow/type-test.cc99.21% <100%> (+0.05%)⬆️
... and 16 more

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 2ca6fe8...973d80f. Read the comment docs.

Comment threadformat/Schema.fbs Outdated
@emkornfieldemkornfield changed the title ARROW-352:[Format] Add time resolution to Interval by creating a new typeARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeFeb 23, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm could you look at the format changes to see if you are ok with them?
@pravindra Can you look at the impact on the java side (I added all the necessary java classes I think) to confirm this is acceptable for the Java?

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Failure was NodeJs

@koukou changed the title ARROW-352:[Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeFeb 24, 2019
@pravindra

Copy link
Copy Markdown
Contributor

since this is a format change (backward compatible though), I'll wait for @wesm to approve too before merging.

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@pravindra thanks for the review

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Looking over the old e-mail threads it might be that TimeDelta or TimestampDelta is a better name for this type?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm based on comments on the other JIRAs CLs it seems like it would be desirable to add an implementation for C++, I can add that to this CL but would you mind taking a look to see if you are ok with naming/modeling (I would prefer not to have to refactor just due to naming issues if possible).

@emkornfieldemkornfield changed the title ARROW-352: [Format][Java] Add time resolution to Interval by creating a new typeARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 12, 2019
@emkornfieldemkornfield changed the title ARROW-352: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++] Add time resolution to Interval by creating a new typeARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeApr 29, 2019
@emkornfieldemkornfield changed the title ARROW-835: [WIP][Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new DurationInterval typeApr 30, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

I believe the Python on OS/X error is spurious (it was green on previous build).

@wesm

wesm commented May 3, 2019

Copy link
Copy Markdown
Member

Will work on reviewing the C++ side of this

@wesmwesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The C++ side of this, and the changes to the Flatbuffers files, all looks good to me. Thanks @emkornfield for slogging through this and implementing C++, Java, and integration tests in one go!

One question I have is whether we want to commit to the name "DurationInterval" rather than alternatives such as "Duration" or "TimeDelta" or "TimeDuration". I don't think the names are sacred

Can someone (@siddharthteotia ?) carve out a little time to review the Java so we can try to get this merged soon?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think it's possible to collapse this into a single class? There was an effort to do this for Timestamp (with a TimeUnit class) but it failed only because Dremio had taken on dependency with the TimestampUNIT classes

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Potentially, I followed the pattern already established in the codebase, but I'm open to trying if it is desirable. @pravindra@siddharthteotia do you think this is desirable/possible?

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.

Sounds okay to me. Let's see what @siddharthteotia and @pravindra say.

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.

IMO, having a single class is definitely desirable. Single this one is starting on a fresh slate, it's worth a try.

Comment threadcpp/src/arrow/array.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, I'm a bit disappointed that we aren't deprecating this type =/

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I didn't want to get dragged into what it means deprecate this, should be easy enough to do if we want it. As noted below I tried to say it was optional which I seem to recall seeing this was ok on a previous ML thread.

Comment threadcpp/src/arrow/array/builder_time.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this redundant with type_fwd.h?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, it appears so, I'll push a commit removing them. It looks like there might be more redundancy in builder_primitive.h

Comment threadcpp/src/arrow/builder.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think static_cast (or checked_cast) is sufficient here?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

Comment threadcpp/src/arrow/type.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: as far as naming I could see an argument for using

  • interval_duration
  • interval_day_time
  • interval_month

but I'm OK with the way things are here

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I could see this to, but I'm happier without the reverse notation.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

note "duration" conflicts with some of our time classes so I renamed to "duration_type", hopefully that is ok

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"some of our time classes"?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Need to look back I think it was in the vendored time library we were using. I can look deeper if you don't think there should be a conflict

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

looking again they shouldn't conflict, I will try to fix this today.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome, thanks.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

renamed. had to touch some of the vendored code.

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it. If it isn't being deprecated then it's reasonable to implement it in C++ and have integration tests

Comment threadformat/Schema.fbs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you happy with "DurationInterval"? It could also be called simply "Duration" or "TimeDuration"

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm Thanks for the review I'll try to address comments in the next few days. In terms of naming, I don't know the etiquette for changing the name once it gets approved on the ML. If was going to change it, I think Duration would be my choice.

@pravindra already reviewed most of the java code, the main changes that happened where plumbing through support for the integration test.

Comment threadcpp/src/arrow/array/builder_dict.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just for your information.

These changes will be conflicted with #4255.
If #4255 is merged, we will be able to just remove these changes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks, they were removed.

@emkornfieldemkornfield changed the title ARROW-835: [Format][C++][Java] Create a new DurationInterval typeARROW-835: [Format][C++][Java] Create a new Duration typeMay 13, 2019
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

@wesm I think I addressed all your feedback. The OS/X build seems to in an infinite CMake loop with something like

 the following targets are still affected by RPATH settings:
arrow_python_shared
arrow_shared
arrow_testing_shared
parquet_shared
plasma_shared

I'm not sure why my change would have caused this. Any thoughts?

@pravindra I was able to consolidate all the java vectors into one, could you take a look?

@emkornfield
emkornfieldforce-pushed the new_type branch 2 times, most recently from 2913b09 to 773a2b0CompareMay 15, 2019 19:28
@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Baffling

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

It must have something to do with this being an older PR. Is Appveyor enabled on your fork? If not I can push this to my fork to get an Appveyor build going

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

No appveyor isn't enabled on my fork. let me try squashing everything, see if that helps.

and mark DayTimeInterval as deprecated.
Provides implementation for Duration, DayTimeInterval and YearMonth
interval in C++ and Java (for duration). Adds integration test.
@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Ahh, squash seems to have worked, lets hope things stay green.

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

@emkornfield it looks you made some changes to vendored code which I think we should try to avoid doing in general, can we open a JIRA to restore to the vendored version and address the name conflict another way? I don't want this issue to block the patch since I need this to go in and then rebase #4316 on top

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Appveyor appears to be about ~6 hours backed up so I'm going to push a branch on my fork to try to get a quicker thumbs up to merge this

@wesm

wesm commented May 15, 2019

Copy link
Copy Markdown
Member

Here's an Appveyor build starting now on my fork which will take a while to run https://ci.appveyor.com/project/wesm/arrow/builds/24577591

@emkornfield

Copy link
Copy Markdown
ContributorAuthor

Thanks. https://issues.apache.org/jira/browse/ARROW-5346 opened to revert the changes. Right now the only solution seems like reordering includes in some cases or fixing upstream. I will have to think about this.

@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Appveyor build looks OK, I'm going to wait a little while yet to make sure the MinGW build works before merging

@emkornfield

emkornfield commented May 16, 2019

Copy link
Copy Markdown
ContributorAuthor

@wesm appveyor on your branch looks all green.

@wesmwesm closed this in 6f80ea4May 16, 2019
@wesm

wesm commented May 16, 2019

Copy link
Copy Markdown
Member

Awesome. Thanks @emkornfield!!

@emkornfield
emkornfield deleted the new_type branch May 16, 2019 03:19
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
- Create a new DurationInterval type in format.
- Implement all interval types in C++ and Java including integration test.
Once this is checked in, I think https://issues.apache.org/jira/browse/ARROW-352 can be resolved as a won't fix?
Author: Micah Kornfield <emkornfield@gmail.com>
Closesapache#3644 from emkornfield/new_type and squashes the following commits:
cc6d39c <Micah Kornfield> remove system clock
daf8b4f <Micah Kornfield> duration_type->duration
b064816 <Micah Kornfield> Introduce a new Duration type can that represent time deltas, and mark DayTimeInterval as deprecated.
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.

6 participants

@emkornfield@codecov-io@pravindra@wesm@kou@jacques-n