[ 
https://issues.apache.org/jira/browse/SPARK-6994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14517882#comment-14517882
 ] 

Shuai Zheng edited comment on SPARK-6994 at 4/28/15 7:48 PM:
-------------------------------------------------------------

I create one more pull request:
https://github.com/apache/spark/pull/5754
add few helper method to access field value by name also return type.
Basically create:
getBoolean(fieldName: String)
getByte(fieldName: String)
getShort(fieldName: String)
getInt(fieldName: String)
getLong(fieldName: String)
getFloat(fieldName: String)
getDouble(fieldName: String)
getString(fieldName: String)
getDecimal(fieldName: String)

This is a trial change, to make java developers life easier (like me...*_*), as 
we won't benefit from generic feature on getAs[T] 

Because this is not really a fix, so I think I should not re-open a ticket. 
Just update here.


was (Author: szheng79):
I create one more pull request:
https://github.com/apache/spark/pull/5754
add few helper method to access field value by name also return type.
Basically create:
getBoolean(fieldName: String)
getByte(fieldName: String)
getShort(fieldName: String)
getInt(fieldName: String)
getLong(fieldName: String)
getFloat(fieldName: String)
getDouble(fieldName: String)
getString(fieldName: String)
getDecimal(fieldName: String)

This is a trial change, to make java developers life easier (like me...*_*), as 
we won't benefit from generic feature on getAs[T] 

> Allow to fetch field values by name in sql.Row
> ----------------------------------------------
>
>                 Key: SPARK-6994
>                 URL: https://issues.apache.org/jira/browse/SPARK-6994
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.3.0
>            Reporter: vidmantas zemleris
>            Assignee: vidmantas zemleris
>            Priority: Minor
>              Labels: dataframe, row
>             Fix For: 1.4.0
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> It looked weird that up to now there was no way in Spark's Scala API to 
> access fields of `DataFrame/sql.Row` by name, only by their index.
> This tries to solve this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to