-
Notifications
You must be signed in to change notification settings - Fork 20
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
SIT-2037 Add support for com.snowflake.snowpark.Row.getAs
function
#148
Conversation
6d48c05
to
68f4ec2
Compare
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.
I see this PR missed structured types and timestamp types, what is the plan to support them?
@sfc-gh-bli Can you explain in more detail which scenarios are not covered yet with this implementation, please? For example, calling the function val schema = StructType(StructField("c1", TimestampType))
val data = Seq(Row(new Timestamp(System.currentTimeMillis())))
val row = session.createDataFrame(data, schema).collect()(0)
row.getAs[Timestamp](0) == row.getTimestamp(0) // true Regarding the structured types, I think it is similar to the above scenario. Those types will fall in the default case: |
dab3fb3
to
e91aaa0
Compare
5bec589
to
c8ebed8
Compare
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.
lgtm
c8ebed8
to
53dbc50
Compare
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SIT-2037
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
It adds a new function to the
Row
class that returns the value at the specified column index and casts it to the desired type.Pre-review checklist
(For Snowflake employees)