-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GH-15810] Allow the user to adjust parquet import timezone #16304
base: rel-3.46.0
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import sys | ||
|
||
sys.path.insert(1, "../../../") | ||
from tests import pyunit_utils | ||
from h2o.frame import H2OFrame | ||
import tempfile | ||
import h2o | ||
|
||
''' | ||
Adjust timestamp parquet | ||
''' | ||
|
||
def adjust_timestamp_parquet(): | ||
with tempfile.TemporaryDirectory() as dir: | ||
timestamp_df = H2OFrame({"timestamp": '2024-06-06 06:06:06'}) | ||
h2o.export_file(timestamp_df, path=dir, format="parquet", write_checksum=False) | ||
imported_df = h2o.import_file(dir) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if it would be better to have this option as an export_file parameter.. I see you implement the workaround
What if user want to manipulate data into different timezones? In this case, they need to restart the cloud with the new jvm arguments. Am I right or I just overthinking it and its not a probable usecase? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And what if user want to adjust the timezone just for the one file, and leave it "as is" for the rest of them? It will also require a restart There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the story was that the users were importing a file and were expecting to see their timezone - the same behavior as Apache Spark if I'm not mistaken - spark is assuming the timestamp is in GMT and then showing it to the user in their own timezone - we do not do that, we just show the "real" value There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more technical user can adjust on their own though, but very valid points! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main user experience issue is that you need to think about the future import of parquet file when you start the h2o. I think its worth to have it as an import (not export) option in the function. WDYT @wendycwong? Come to think of it, what happen if you import your file with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true |
||
expected_df = H2OFrame({"timestamp": '2024-06-06 08:06:06'}) | ||
pyunit_utils.compare_frames(expected_df, imported_df, numElements=1) | ||
|
||
if __name__ == "__main__": | ||
pyunit_utils.standalone_test(adjust_timestamp_parquet, init_options={"jvm_custom_args": ["-Dsys.ai.h2o.parquet.import.timestamp.adjustment=2"]}) | ||
else: | ||
adjust_timestamp_parquet() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add comment what value we expecting here? I saw it from the tests that it a number representing the hours. What happen if user put something outside of +-24?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no limit basically, someone can adjust for example +- a month