-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
handling Date type in HCatToRow #20685
Comments
Hey @damccorm , do you think I could help out? --- I'm looking for a good first issue here! |
Sure - to assign the issue to yourself, you can comment |
.take-issue |
Some initial notes: - The issue (apache#20685) deals with java.sql.Date, which I wasn't able to reproduce fully (I can currently write hcatalog hadoop.hive date) - On this note, 267f76f changed the code involved so that there's a direct cast to AbstractInstant in RowUtils.java. This doesn't change much, but jfyi.
Hey @damccorm , fyi, I don't think I can set reviewers to the PR above, so it'd be great if you could take a look when you can! |
Reviewers should get auto-assigned (looks like this happened in your PR, so you should be set 🙂) - thanks! |
* Handle Date type in HCatToRow Some initial notes: - The issue (#20685) deals with java.sql.Date, which I wasn't able to reproduce fully (I can currently write hcatalog hadoop.hive date) - On this note, 267f76f changed the code involved so that there's a direct cast to AbstractInstant in RowUtils.java. This doesn't change much, but jfyi. * Run: ./gradlew :sdks:java:io:hcatalog:spotlessApply * review cr: castTypes util - s/castHDate/maybeCastHDate/ to be more concise - move values manipulation to a separate util (hopefully, I understood the cr in the right way)
That's great, thanks! I'll close this one, but you can also do it by commenting |
* Handle Date type in HCatToRow Some initial notes: - The issue (apache#20685) deals with java.sql.Date, which I wasn't able to reproduce fully (I can currently write hcatalog hadoop.hive date) - On this note, 267f76f changed the code involved so that there's a direct cast to AbstractInstant in RowUtils.java. This doesn't change much, but jfyi. * Run: ./gradlew :sdks:java:io:hcatalog:spotlessApply * review cr: castTypes util - s/castHDate/maybeCastHDate/ to be more concise - move values manipulation to a separate util (hopefully, I understood the cr in the right way)
When I convert HCatRecord include Date type record to Row, it failed with the following errors.
It occurs because HCatalogIO reads Date type as java.sql.Date in HCatRecord, but Row class doesn't support Date and HCatToRow doesn't care about it.
I think there are two solution about it.
Row type supports Date type(java.util.Date or java.sql.Date)
I don't know another IO classes enough, but there may be another IO classes which has same problem, and this solution may be able to solve those problem.
Add logic to convert Date type to Datetime type in HCatToRow
The impact of change will be smaller then 1. because it doesn't change Row class.
Which would be better?
Imported from Jira BEAM-10934. Original Jira may contain additional context.
Reported by: hayashidac.
The text was updated successfully, but these errors were encountered: